Skip to content
FutureBlitz

    Install

    Import std.math.fixed

    Fixed64

    std.math.fixed

    struct

    Public Struct Fixed64 Implements Numeric, Comparable, Hashable, Bounded, Printable, Defaultable

    A number with 32 bits for its whole part, its sign among them, and 32 after the point: from -2147483648 to 2147483647.9999999998, in steps of 1 / 4294967296.

    std/math/fixed.fb, line 455

    • Public Static Method FromRaw(bits: Int64): Fixed64 static method #

      The Fixed64 these bits are, as Raw gives them.

    • @PanicsAtCaller Public Static Method FromInt(value: Int64): Fixed64 static method #

      The whole number. One outside an Int's range panics.

    • @PanicsAtCaller Public Static Method FromDouble(value: Double): Fixed64 static method #

      The Double, rounded to the nearest Fixed64, halves away from 0. One outside a Fixed64's range, or NaN, panics.

    • @PanicsAtCaller Public Static Method FromFloat(value: Float): Fixed64 static method #

      The Float, rounded to the nearest Fixed64. One outside a Fixed64's range, or NaN, panics.

    • Public Static Method Zero(): Fixed64 static method #

      The zero Fixed64, which adding leaves alone.

    • Public Static Method One(): Fixed64 static method #

      The Fixed64 1, raw 4294967296, which multiplying leaves alone.

    • Public Static Method DefaultValue(): Fixed64 static method #

      The zero Fixed64.

    • Public Static Method MinValue(): Fixed64 static method #

      The lowest Fixed64, -2147483648.

    • Public Static Method MaxValue(): Fixed64 static method #

      The highest Fixed64, about 2147483647.9999999998.

    • Public Static Method DoubleValue(value: Fixed64): Double static method #

      The value as the nearest Double, which holds its 53 most significant bits.

    • Public Static Property Pi: Fixed64 property #

      Pi, and a turn, 2 Pi, rounded to a Fixed64's steps.

    • Public Static Property Tau: Fixed64 property #

      A turn, 2 Pi, rounded to a Fixed64's steps.

    • Public Property Raw: Int64 property #

      The value's bits, the value times 4294967296.

    • Public Method ToDouble(): Double method #

      The value as a Double, rounded to the nearest, which holds it exactly up to 2^21.

    • Public Method ToFloat(): Float method #

      The value as a Float, rounded to the nearest: once, from the bits, since a Double of them can round already.

    • Public Method ToInt(): Int method #

      The whole part, toward 0, as As takes a Float's.

    • @PanicsAtCaller Public Method ToFixed32(): Fixed32 method #

      The value as a Fixed32, rounded to the nearest, halves up. One outside a Fixed32's range overflows, as Narrowed says.

    • Public Method ToString(): String method #

      The value in decimal, from its bits: its whole part, and the fewest digits after the point that are nearer it than any other Fixed64, so no two print alike and none prints past what it holds.

    • @PanicsAtCaller Operator +(a: Fixed64, b: Fixed64): Fixed64 operator #

      a plus b. Panics in a debug build when it's past what a Fixed64 holds, and wraps in a release one.

    • @PanicsAtCaller Operator -(a: Fixed64, b: Fixed64): Fixed64 operator #

      a minus b. Panics in a debug build when it's past what a Fixed64 holds, and wraps in a release one.

    • @PanicsAtCaller Operator -(a: Fixed64): Fixed64 operator #

      a negated.

    • Operator <(a: Fixed64, b: Fixed64): Bool operator #

      Whether a is less than b.

    • @PanicsAtCaller Operator *(a: Fixed64, b: Fixed64): Fixed64 operator #

      a times b. Panics in a debug build when it's past what a Fixed64 holds, and wraps in a release one. Rounded to the nearest.

    • @PanicsAtCaller Operator *(a: Fixed64, b: Int64): Fixed64 operator #

      a times b.

    • @PanicsAtCaller Operator *(a: Int64, b: Fixed64): Fixed64 operator #

      a times b.

    • @PanicsAtCaller Operator /(a: Fixed64, b: Fixed64): Fixed64 operator #

      a divided by b. A b of 0 panics, and a quotient past what it holds does as + does.

    • @PanicsAtCaller Operator /(a: Fixed64, b: Int64): Fixed64 operator #

      a divided by b.

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