Skip to content
FutureBlitz

    Install

    Import std.math.constants

    std.math.constants

    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.

    std/math/constants.fb, line 7

    Tau const

    Public Const Tau: Float = 6.28318530717958647692

    A turn: 2 Pi.

    std/math/constants.fb, line 9

    E const

    Public Const E: Float = 2.71828182845904523536

    Euler's number, e: the base of the natural logarithm.

    std/math/constants.fb, line 11

    Epsilon const

    Public Const Epsilon: Float = 1.1920929e-7

    The gap between 1 and the next Float above it.

    std/math/constants.fb, line 13

    Pi64 const

    Public Const Pi64: Double = 3.14159265358979323846

    Pi, as a Double.

    std/math/constants.fb, line 16

    Tau64 const

    Public Const Tau64: Double = 6.28318530717958647692

    A turn, 2 Pi, as a Double.

    std/math/constants.fb, line 18

    E64 const

    Public Const E64: Double = 2.71828182845904523536

    Euler's number, e, as a Double.

    std/math/constants.fb, line 20

    Epsilon64 const

    Public Const Epsilon64: Double = 2.220446049250313e-16

    The gap between 1 and the next Double above it.

    std/math/constants.fb, line 22

    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.

    std/math/constants.fb, line 26

    NaN const

    Public Const NaN: Float = Float.FromBits(0x7FC00000)

    Not a number, which isn't equal to itself, as 0 / 0 gives.

    std/math/constants.fb, line 28

    Report an issue with this page or with FutureBlitz on GitHub.