Import std.math.constants
std.math.constants
Math's constants, like Pi and E, as Floats and as Doubles.
The constants of math, as Floats, the type std.math works in, and as Doubles, named with 64: Pi64. Inf and NaN are a Float's, which a Double holds the same.
std/math/constants.fb
Constants and globals
Pi
const
Public Const Pi: Float = 3.14159265358979323846
Pi, half a turn: a circle's circumference over its diameter.
Examples
Expect(IsClose(Sin(Pi / 2), 1.0))
Expect(Tau == 2 * Pi)
Expect(Pi64 > 3.14159265358 && Pi64 < 3.14159265359)
Tau
const
Public Const Tau: Float = 6.28318530717958647692
A turn: 2 Pi.
E
const
Public Const E: Float = 2.71828182845904523536
Euler's number, e: the base of the natural logarithm.
Epsilon
const
Public Const Epsilon: Float = 1.1920929e-7
The gap between 1 and the next Float above it.
Pi64
const
Public Const Pi64: Double = 3.14159265358979323846
Pi, as a Double.
Tau64
const
Public Const Tau64: Double = 6.28318530717958647692
A turn, 2 Pi, as a Double.
E64
const
Public Const E64: Double = 2.71828182845904523536
Euler's number, e, as a Double.
Epsilon64
const
Public Const Epsilon64: Double = 2.220446049250313e-16
The gap between 1 and the next Double above it.
Inf
const
Public Const Inf: Float = Float.FromBits(0x7F800000)
Infinity and not-a-number, which the compiler doesn't work out, so the program does as it starts.
NaN
const
Public Const NaN: Float = Float.FromBits(0x7FC00000)
Not a number, which isn't equal to itself, as 0 / 0 gives.
Report an issue with this page or with FutureBlitz on GitHub.