<!--
{
  "documentType" : "article",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/Float/FloatingPoint-Implementations",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "FloatingPoint Implementations"
}
-->

# FloatingPoint Implementations

## Topics

### Operators

[`static func * (Float, Float) -> Float`](/documentation/Swift/Float/*(_:_:))

Multiplies two values and produces their product, rounding to a
representable value.

[`static func *= (inout Float, Float)`](/documentation/Swift/Float/*=(_:_:))

Multiplies two values and stores the result in the left-hand-side
variable, rounding to a representable value.

[`static func + (Float, Float) -> Float`](/documentation/Swift/Float/+(_:_:))

Adds two values and produces their sum, rounded to a
representable value.

[`static func += (inout Float, Float)`](/documentation/Swift/Float/+=(_:_:))

Adds two values and stores the result in the left-hand-side variable,
rounded to a representable value.

[`static func - (Float) -> Float`](/documentation/Swift/Float/-(_:))

Calculates the additive inverse of a value.

[`static func - (Float, Float) -> Float`](/documentation/Swift/Float/-(_:_:))

Subtracts one value from another and produces their difference, rounded
to a representable value.

[`static func -= (inout Float, Float)`](/documentation/Swift/Float/-=(_:_:))

Subtracts the second value from the first and stores the difference in
the left-hand-side variable, rounding to a representable value.

[`static func / (Float, Float) -> Float`](/documentation/Swift/Float/_(_:_:))

Returns the quotient of dividing the first value by the second, rounded
to a representable value.

[`static func > (Self, Self) -> Bool`](/documentation/Swift/Float/_(_:_:)-552jr)

[`static func /= (inout Float, Float)`](/documentation/Swift/Float/_=(_:_:))

Divides the first value by the second and stores the quotient in the
left-hand-side variable, rounding to a representable value.

[`static func <= (Self, Self) -> Bool`](/documentation/Swift/Float/_=(_:_:)-5yoz5)

[`static func >= (Self, Self) -> Bool`](/documentation/Swift/Float/_=(_:_:)-9o6ha)

### Initializers

[`init(Int)`](/documentation/Swift/Float/init(_:)-6cvkq)

Creates a new value, rounded to the closest possible representation.

[`init<Source>(Source)`](/documentation/Swift/Float/init(_:)-7e965)

Creates a new value, rounded to the closest possible representation.

[`init?<Source>(exactly: Source)`](/documentation/Swift/Float/init(exactly:)-uz92)

Creates a new value, if the given integer can be represented exactly.

[`init(sign: FloatingPointSign, exponent: Int, significand: Float)`](/documentation/Swift/Float/init(sign:exponent:significand:))

Creates a new value from the given sign, exponent, and significand.

[`init(signOf: Float, magnitudeOf: Float)`](/documentation/Swift/Float/init(signOf:magnitudeOf:))

Creates a new floating-point value using the sign of one value and the
magnitude of another.

[`init(signOf: Self, magnitudeOf: Self)`](/documentation/Swift/Float/init(signOf:magnitudeOf:)-6i9uw)

Creates a new floating-point value using the sign of one value and the
magnitude of another.

### Instance Properties

[`var exponent: Int`](/documentation/Swift/Float/exponent-swift.property)

The exponent of the floating-point value.

[`var floatingPointClass: FloatingPointClassification`](/documentation/Swift/Float/floatingPointClass)

The classification of this value.

[`var isCanonical: Bool`](/documentation/Swift/Float/isCanonical)

A Boolean value indicating whether the instance’s representation is in
its canonical form.

[`var isFinite: Bool`](/documentation/Swift/Float/isFinite)

A Boolean value indicating whether this instance is finite.

[`var isInfinite: Bool`](/documentation/Swift/Float/isInfinite)

A Boolean value indicating whether the instance is infinite.

[`var isNaN: Bool`](/documentation/Swift/Float/isNaN)

A Boolean value indicating whether the instance is NaN (“not a number”).

[`var isNormal: Bool`](/documentation/Swift/Float/isNormal)

A Boolean value indicating whether this instance is normal.

[`var isSignalingNaN: Bool`](/documentation/Swift/Float/isSignalingNaN)

A Boolean value indicating whether the instance is a signaling NaN.

[`var isSubnormal: Bool`](/documentation/Swift/Float/isSubnormal)

A Boolean value indicating whether the instance is subnormal.

[`var isZero: Bool`](/documentation/Swift/Float/isZero)

A Boolean value indicating whether the instance is equal to zero.

[`var nextDown: Self`](/documentation/Swift/Float/nextDown)

The greatest representable value that compares less than this value.

[`var nextUp: Float`](/documentation/Swift/Float/nextUp)

The least representable value that compares greater than this value.

[`var sign: FloatingPointSign`](/documentation/Swift/Float/sign)

The sign of the floating-point value.

[`var significand: Float`](/documentation/Swift/Float/significand)

The significand of the floating-point value.

[`var ulp: Float`](/documentation/Swift/Float/ulp)

The unit in the last place of this value.

### Instance Methods

[`func addProduct(Float, Float)`](/documentation/Swift/Float/addProduct(_:_:))

Adds the product of the two given values to this value in place, computed
without intermediate rounding.

[`func addingProduct(Self, Self) -> Self`](/documentation/Swift/Float/addingProduct(_:_:))

Returns the result of adding the product of the two given values to this
value, computed without intermediate rounding.

[`func formRemainder(dividingBy: Float)`](/documentation/Swift/Float/formRemainder(dividingBy:))

Replaces this value with the remainder of itself divided by the given
value.

[`func formSquareRoot()`](/documentation/Swift/Float/formSquareRoot())

Replaces this value with its square root, rounded to a representable
value.

[`func formTruncatingRemainder(dividingBy: Float)`](/documentation/Swift/Float/formTruncatingRemainder(dividingBy:))

Replaces this value with the remainder of itself divided by the given
value using truncating division.

[`func isEqual(to: Float) -> Bool`](/documentation/Swift/Float/isEqual(to:))

Returns a Boolean value indicating whether this instance is equal to the
given value.

[`func isLess(than: Float) -> Bool`](/documentation/Swift/Float/isLess(than:))

Returns a Boolean value indicating whether this instance is less than the
given value.

[`func isLessThanOrEqualTo(Float) -> Bool`](/documentation/Swift/Float/isLessThanOrEqualTo(_:))

Returns a Boolean value indicating whether this instance is less than or
equal to the given value.

[`func isTotallyOrdered(belowOrEqualTo: Self) -> Bool`](/documentation/Swift/Float/isTotallyOrdered(belowOrEqualTo:))

Returns a Boolean value indicating whether this instance should precede
or tie positions with the given value in an ascending sort.

[`func negate()`](/documentation/Swift/Float/negate())

Replaces this value with its additive inverse.

[`func remainder(dividingBy: Self) -> Self`](/documentation/Swift/Float/remainder(dividingBy:))

Returns the remainder of this value divided by the given value.

[`func round()`](/documentation/Swift/Float/round())

[`func round(FloatingPointRoundingRule)`](/documentation/Swift/Float/round(_:))

Rounds the value to an integral value using the specified rounding rule.

[`func rounded() -> Self`](/documentation/Swift/Float/rounded())

[`func rounded(FloatingPointRoundingRule) -> Self`](/documentation/Swift/Float/rounded(_:))

Returns this value rounded to an integral value using the specified
rounding rule.

[`func squareRoot() -> Self`](/documentation/Swift/Float/squareRoot())

Returns the square root of the value, rounded to a representable value.

[`func truncatingRemainder(dividingBy: Self) -> Self`](/documentation/Swift/Float/truncatingRemainder(dividingBy:))

Returns the remainder of this value divided by the given value using
truncating division.

### Type Aliases

[`typealias Exponent`](/documentation/Swift/Float/Exponent-swift.typealias)

A type that can represent any written exponent.

### Type Properties

[`static var greatestFiniteMagnitude: Float`](/documentation/Swift/Float/greatestFiniteMagnitude)

The greatest finite number representable by this type.

[`static var infinity: Float`](/documentation/Swift/Float/infinity)

Positive infinity.

[`static var leastNonzeroMagnitude: Float`](/documentation/Swift/Float/leastNonzeroMagnitude)

The least positive number.

[`static var leastNormalMagnitude: Float`](/documentation/Swift/Float/leastNormalMagnitude)

The least positive normal number.

[`static var nan: Float`](/documentation/Swift/Float/nan)

A quiet NaN (“not a number”).

[`static var pi: Float`](/documentation/Swift/Float/pi)

The mathematical constant pi (π), approximately equal to 3.14159.

[`static var radix: Int`](/documentation/Swift/Float/radix)

The radix, or base of exponentiation, for a floating-point type.

[`static var signalingNaN: Float`](/documentation/Swift/Float/signalingNaN)

A signaling NaN (“not a number”).

[`static var ulpOfOne: Float`](/documentation/Swift/Float/ulpOfOne)

The unit in the last place of 1.0.

[`static var ulpOfOne: Self`](/documentation/Swift/Float/ulpOfOne-1s81z)

The unit in the last place of 1.0.

### Type Methods

[`static func maximum(Self, Self) -> Self`](/documentation/Swift/Float/maximum(_:_:))

Returns the greater of the two given values.

[`static func maximumMagnitude(Self, Self) -> Self`](/documentation/Swift/Float/maximumMagnitude(_:_:))

Returns the value with greater magnitude.

[`static func minimum(Self, Self) -> Self`](/documentation/Swift/Float/minimum(_:_:))

Returns the lesser of the two given values.

[`static func minimumMagnitude(Self, Self) -> Self`](/documentation/Swift/Float/minimumMagnitude(_:_:))

Returns the value with lesser magnitude.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)