Nulib Fixed Point Math
Nulib Floating Point Math
Bindings to compiler-specific intrinsics wrapped in a nicer interface.
Clamps scalar value into the given range.
Copies the sign-bit from one value to another.
Interpolates between p0 and p3, using a cubic spline with p1 and p2 as control points.
Linearly interpolates between a and b
Returns the larger of the 2 given scalar values.
Returns the smaller of the 2 given scalar values.
Modulates the given value, preserving sign bit.
Quadilaterally interpolates between p0 and p2, with p1 as a control point.
Gets whether the value's sign bit is set.
e = 2.718281...
ln 10 = 2.302585...
ln 2 = 0.693147...
log10e = 0.434294...
log102 = 0.301029...
log2e = 1.442695...
log210 = 3.321928...
1 / π = 0.318309...
2 / π = 0.636619...
2 / √π = 1.128379...
π = 3.141592...
π / 2 = 1.570796...
π / 4 = 0.785398...
√$(HALF) = 0.707106...
√2 = 1.414213...
Math Functions
Important: When possible compiler level intrinsics will be used, but in some cases this is not possible; in those cases we opt to focus on readability over performance.
As such these math functions may not be the most performant.