---
title: "NSSwapHostDoubleToBig(_:)"
framework: foundation
role: symbol
role_heading: Function
path: "foundation/nsswaphostdoubletobig(_:)"
---

# NSSwapHostDoubleToBig(_:)

Swaps the bytes of a number.

## Declaration

```swift
func NSSwapHostDoubleToBig(_ x: Double) -> NSSwappedDouble
```

## Discussion

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 NSSwapDouble(_:) to perform the swap.

## See Also

### Related Documentation

- [NSSwapBigDoubleToHost(_:)](foundation/nsswapbigdoubletohost(_:).md)
- [NSSwapHostDoubleToLittle(_:)](foundation/nsswaphostdoubletolittle(_:).md)

### Functions

- [NSConvertHostDoubleToSwapped(_:)](foundation/nsconverthostdoubletoswapped(_:).md)
- [NSConvertHostFloatToSwapped(_:)](foundation/nsconverthostfloattoswapped(_:).md)
- [NSConvertSwappedDoubleToHost(_:)](foundation/nsconvertswappeddoubletohost(_:).md)
- [NSConvertSwappedFloatToHost(_:)](foundation/nsconvertswappedfloattohost(_:).md)
- [NSHostByteOrder()](foundation/nshostbyteorder().md)
- [NSSwapBigDoubleToHost(_:)](foundation/nsswapbigdoubletohost(_:).md)
- [NSSwapBigFloatToHost(_:)](foundation/nsswapbigfloattohost(_:).md)
- [NSSwapBigIntToHost(_:)](foundation/nsswapbiginttohost(_:).md)
- [NSSwapBigLongLongToHost(_:)](foundation/nsswapbiglonglongtohost(_:).md)
- [NSSwapBigLongToHost(_:)](foundation/nsswapbiglongtohost(_:).md)
- [NSSwapBigShortToHost(_:)](foundation/nsswapbigshorttohost(_:).md)
- [NSSwapDouble(_:)](foundation/nsswapdouble(_:).md)
- [NSSwapFloat(_:)](foundation/nsswapfloat(_:).md)
- [NSSwapHostDoubleToLittle(_:)](foundation/nsswaphostdoubletolittle(_:).md)
- [NSSwapHostFloatToBig(_:)](foundation/nsswaphostfloattobig(_:).md)
