Import std.math.numbers
std.math.numbers
What the built-in number types share, for std.math's generic Functions: Bounded, the types with
a lowest and a highest value, which every number type is; Integer, the eight integer types; and
FloatingPoint, Float32 and Float64, over C's libm. A Function that takes a T of one of them gets
its type from its arguments, so Lerp(0, 10, t) works in t's type, and its literals follow. Their
Static Methods are for generic code, through a type parameter, as in T.MinValue(); for the types
themselves, std.math's Functions are the way, as MinValue<Int>() and Floor(x).
std/math/numbers.fb
Types
Bounded
interface
Public Interface Bounded
The types with a lowest and a highest value: every number type. A float's are its lowest and highest finite values, not the infinities. Each is a Double too, for math like a Mean.
-
The type's lowest value: a float's lowest finite one.
-
The type's highest value: a float's highest finite one.
-
The
valueas a Double, rounded to the nearest one where a Long's is too large to hold.
Integer
interface
Public Interface Integer Extends Bounded
The eight integer types, whose bits generic code works on through a UInt64.
-
How many bits the type has: 8, 16, 32, or 64.
-
The
value's bits, BitWidth of them, in a UInt64's low bits, the rest 0. -
The value whose bits are the low BitWidth of
bits.
FloatingPoint
interface
Public Interface FloatingPoint Extends Bounded
Float32 and Float64, with what C's libm works out for each. Rounding is half away from 0, and Rem is C's fmod, which is exact.
-
The gap between 1 and the next value above it.
-
The Double as this type, rounded to the nearest
valueit holds. -
The largest whole number no larger than
value. -
The smallest whole number no smaller than
value. -
The whole number nearest
value, a half away from 0. -
valuewithout what's after its point: the whole number toward 0. -
The square root of
value, or NaN for a negative one. -
The cube root of
value. -
e to the power of
value. -
2 to the power of
value. -
The natural logarithm of
value. -
The base 2 logarithm of
value. -
The base 10 logarithm of
value. -
The sine of
value, in radians. -
The cosine of
value, in radians. -
The tangent of
value, in radians. -
The angle, in radians, whose sine is
value. -
The angle, in radians, whose cosine is
value. -
The angle, in radians, whose tangent is
value. -
The angle, in radians, of the point (
x,y) from the positive x axis, from -pi to pi. -
The hyperbolic sine of
value. -
The hyperbolic cosine of
value. -
The hyperbolic tangent of
value. -
The inverse hyperbolic sine of
value. -
The inverse hyperbolic cosine of
value. -
The inverse hyperbolic tangent of
value. -
What's left of
adivided byb, witha's sign, as C's fmod gives it. -
magnitude's size withsign's sign. -
atimesb, plusc, rounded once.
Functions
MinValue
function
Public Function MinValue<T: Bounded>(): T
The lowest value a T holds: for a float, its lowest finite one.
MaxValue
function
Public Function MaxValue<T: Bounded>(): T
The highest value a T holds: for a float, its highest finite one.
Extends
Int8
extend
Extend Int8 Implements Integer
No doc comment.
Int16
extend
Extend Int16 Implements Integer
No doc comment.
Int32
extend
Extend Int32 Implements Integer
No doc comment.
Int64
extend
Extend Int64 Implements Integer
No doc comment.
UInt8
extend
Extend UInt8 Implements Integer
No doc comment.
UInt16
extend
Extend UInt16 Implements Integer
No doc comment.
UInt32
extend
Extend UInt32 Implements Integer
No doc comment.
UInt64
extend
Extend UInt64 Implements Integer
No doc comment.
Float32
extend
Extend Float32 Implements FloatingPoint
No doc comment.
Float64
extend
Extend Float64 Implements FloatingPoint
No doc comment.
Float32
extend
Extend Float32
No doc comment.
-
The Float's bits, as IEEE 754 lays them out.
-
The Float whose IEEE 754
bitsthese are.
Float64
extend
Extend Float64
No doc comment.
-
The Double's bits, as IEEE 754 lays them out.
-
The Double whose IEEE 754
bitsthese are.
Report an issue with this page or with FutureBlitz on GitHub.