# ``Swift/Float``

## Topics

### Converting Integers

- ``Swift/Float/init(_:)-7e965``
- ``Swift/Float/init(_:)-6cvkq``

### Converting Strings

- ``Swift/Float/init(_:)-h2f4``
- ``Swift/Float/init(_:)-4xsj6``

### Converting Floating-Point Values

- ``Swift/Float/init(_:)-1488f``
- ``Swift/Float/init(_:)-1oh9p``
- ``Swift/Float/init(_:)-1kp2p``
- ``Swift/Float/init(_:)-975tv``
- ``Swift/Float/init(_:)-11orc``
- ``Swift/Float/init(_:)-ussz``
- ``Swift/Float/init(signOf:magnitudeOf:)-8aey5``
- ``Swift/Float/init(sign:exponent:significand:)``

### Converting with No Loss of Precision

These initializers result in `nil` if the value passed can't be represented without
any loss of precision.

- ``Swift/Float/init(exactly:)-8esr8``
- ``Swift/Float/init(exactly:)-89na7``
- ``Swift/Float/init(exactly:)-89pn7``
- ``Swift/Float/init(exactly:)-6l5fa``
- ``Swift/Float/init(exactly:)-1h1oe``
- ``Swift/Float/init(exactly:)-8ho5q``

### Creating a Random Value

- ``Swift/Float/random(in:)-6ided``
- ``Swift/Float/random(in:using:)-1m6gf``
- ``Swift/Float/random(in:)-5o5h8``
- ``Swift/Float/random(in:using:)-613hx``

### Performing Calculations

- <doc:floating-point-operators-for-float>
- ``Swift/Float/addingProduct(_:_:)``
- ``Swift/Float/addProduct(_:_:)``
- ``Swift/Float/squareRoot()``
- ``Swift/Float/formSquareRoot()``
- ``Swift/Float/remainder(dividingBy:)``
- ``Swift/Float/formRemainder(dividingBy:)``
- ``Swift/Float/truncatingRemainder(dividingBy:)``
- ``Swift/Float/formTruncatingRemainder(dividingBy:)``
- ``Swift/Float/negate()-9p7hp``

### Rounding Values

- ``Swift/Float/rounded()``
- ``Swift/Float/rounded(_:)``
- ``Swift/Float/round()``
- ``Swift/Float/round(_:)``

### Comparing Values

- <doc:floating-point-operators-for-float>
- ``Swift/Float/isEqual(to:)``
- ``Swift/Float/isLess(than:)``
- ``Swift/Float/isLessThanOrEqualTo(_:)``
- ``Swift/Float/isTotallyOrdered(belowOrEqualTo:)``
- ``Swift/Float/maximum(_:_:)``
- ``Swift/Float/maximumMagnitude(_:_:)``
- ``Swift/Float/minimum(_:_:)``
- ``Swift/Float/minimumMagnitude(_:_:)``

### Finding the Sign and Magnitude

- ``Swift/Float/magnitude-swift.property``
- ``Swift/Float/sign``
- ``Swift/Float/Magnitude-swift.typealias``

### Querying a Float

- ``Swift/Float/ulp``
- ``Swift/Float/significand``
- ``Swift/Float/exponent-swift.property``
- ``Swift/Float/nextUp``
- ``Swift/Float/nextDown``
- ``Swift/Float/binade``

### Accessing Numeric Constants

- ``Swift/Float/pi``
- ``Swift/Float/infinity``
- ``Swift/Float/greatestFiniteMagnitude``
- ``Swift/Float/nan``
- ``Swift/Float/signalingNaN``
- ``Swift/Float/ulpOfOne-18riz``
- ``Swift/Float/leastNormalMagnitude``
- ``Swift/Float/leastNonzeroMagnitude``
- ``Swift/Float/zero``

### Working with Binary Representation

- ``Swift/Float/bitPattern``
- ``Swift/Float/significandBitPattern``
- ``Swift/Float/significandWidth``
- ``Swift/Float/exponentBitPattern``
- ``Swift/Float/significandBitCount``
- ``Swift/Float/exponentBitCount``
- ``Swift/Float/radix``
- ``Swift/Float/init(bitPattern:)``
- ``Swift/Float/init(sign:exponentBitPattern:significandBitPattern:)``
- ``Swift/Float/init(nan:signaling:)``
- ``Swift/Float/Exponent-swift.typealias``
- ``Swift/Float/RawSignificand``

### Querying a Float's State

- ``Swift/Float/isZero``
- ``Swift/Float/isFinite``
- ``Swift/Float/isInfinite``
- ``Swift/Float/isNaN``
- ``Swift/Float/isSignalingNaN``
- ``Swift/Float/isNormal``
- ``Swift/Float/isSubnormal``
- ``Swift/Float/isCanonical``
- ``Swift/Float/floatingPointClass``

### Encoding and Decoding Values

- ``Swift/Float/encode(to:)``
- ``Swift/Float/init(from:)``

### Creating a Range

- ``Swift/Float/..<(_:_:)``
- ``Swift/Float/...(_:_:)``

### Describing a Float

- ``Swift/Float/hash(into:)``
- ``Swift/Float/description``
- ``Swift/Float/debugDescription``
- ``Swift/Float/customMirror``

### SIMD-Supporting Types

- ``Swift/Float/SIMDMaskScalar``
- ``Swift/Float/SIMD2Storage``
- ``Swift/Float/SIMD4Storage``
- ``Swift/Float/SIMD8Storage``
- ``Swift/Float/SIMD16Storage``
- ``Swift/Float/SIMD32Storage``
- ``Swift/Float/SIMD64Storage``

### Infrequently Used Functionality

- ``Swift/Float/init()``
- ``Swift/Float/init(integerLiteral:)-3jm4z``
- ``Swift/Float/init(floatLiteral:)``
- ``Swift/Float/init(integerLiteral:)-6hc7h``
- ``Swift/Float/advanced(by:)``
- ``Swift/Float/distance(to:)``
- ``Swift/Float/write(to:)``

### Deprecated

- ``Swift/Float/customPlaygroundQuickLook``
