Swaps the bytes of a number.
SDKs
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Foundation
Declaration
func NSSwapHostDoubleToBig(_ x: Double) -> NSSwapped Double
Discussion
Converts the value in x
, specified in the current endian format, to big-endian format and returns the resulting value. If it is necessary to swap the bytes, this function calls NSSwap
to perform the swap.