SplitScript reference / f64

f64

Built-in type

f64

Stores a 64-bit floating-point number.

Floating-point values are useful for game coordinates, timers, and duration conversion. Decimal exponents and finite subnormal values are supported. Unconstrained floating-point literals and values specifically constrained as Float default to f64. Memory reads never use this default and require an explicit or otherwise exact representation.

Examples

Use f64

let smallestPositive: f64 = 5e-324

Capabilities

MemberDescriptionAvailable through
FloatIdentifies floating-point types.
MemoryReadableSupports deserialization from process memory.

Operators

MemberDescriptionAvailable through
==Reports whether this value and another value are equal.Available through Equatable
!=Reports whether this value and another value differ.Available through Equatable
+Adds another value of the same numeric type.Available through Numeric
/Divides by another value of the same numeric type.Available through Numeric
*Multiplies by another value of the same numeric type.Available through Numeric
-Subtracts another value of the same numeric type.Available through Numeric
-Returns this value with its sign inverted.Available through Signed

Methods

MemberDescriptionAvailable through
debugStringConverts the receiver to its unambiguous structural representation.Available through Debug
toStringConverts the receiver to its user-facing string representation.Available through Display
ceilRounds up to the nearest integral value.Available through Float
floorRounds down to the nearest integral value.Available through Float
isFiniteReturns whether the receiver is neither infinity nor NaN.Available through Float
isNaNReturns whether the receiver is the floating-point not-a-number value.Available through Float
roundRounds to the nearest integral value, with halfway values rounded to even.Available through Float
roundToRounds to a requested number of digits after the decimal point.Available through Float
sqrtReturns the principal square root of this value.Available through Float
truncateRounds this value toward zero to an integral value.Available through Float
clampRestricts a numeric value to an inclusive range.Available through Numeric
maxReturns the larger of two numeric values.Available through Numeric
minReturns the smaller of two numeric values.Available through Numeric
squaredMultiplies this value by itself.Available through Numeric
swapBytesReverses the order of the bytes in this numeric value.Available through Numeric
absReturns this value without a negative sign.Available through Signed
NaNThe canonical 64-bit not-a-number value.
fromBitsConstructs a 64-bit float from its exact IEEE-754 bit pattern.
negativeInfinityNegative infinity as a 64-bit floating-point value.
positiveInfinityPositive infinity as a 64-bit floating-point value.
toBitsReturns this float's exact IEEE-754 bit pattern.