iz.math

Several simple math functions.

They are rather dedicated to the X86_64 architecture but implemented for X86 too, even if parameters loading is less adequate and slower under this architecture.

Members

Aliases

variableEllipse
alias variableEllipse = VariableEllipse
variableParabol
alias variableParabol = VariableParabol
variablePow
alias variablePow = VariablePow

Functions

ceil
int ceil(T value)

Converts a floating point value to an integer.

dtrunc
int dtrunc(T value)

Converts a floating point value to an integer.

floor
int floor(T value)

Converts a floating point value to an integer.

hypot
T hypot(T x, T y)

Computes the hypothenus of two FP numbers.

logN
double logN(double x, double y)

Retrieves the exponent part on the result of pow().

magn
auto magn(T t)

Returns the magnitude of a complex number.

round
int round(T value)

Converts a floating point value to an integer.

roundToNearest
const(int) roundToNearest()

Resets the default rounding mode.

roundToNegative
const(int) roundToNegative()

Sets round() to behave like ceil().

roundToPositive
const(int) roundToPositive()

Sets round() to behave like floor().

roundToZero
const(int) roundToZero()

Sets round() to behave like trunc().

saveIzRoundingMode
const(int) saveIzRoundingMode()

Saves the rounding mode used in iz.math (always the 13th and 14th bit of SSE MXCSR).

setIzRoundingMode
void setIzRoundingMode(int value)

Restores the rounding mode used in iz.math (MXCSR).

trunc
int trunc(T value)

Converts a floating point value to an integer.

wrap
T wrap(T value, T max)

Wraps a numeric value between 0 and a max value.

Manifest constants

logHalf
enum logHalf;

Log(0.5) as a double;

Structs

VariableEllipse
struct VariableEllipse

An parametric easing function based on the Supper Ellipse.

VariableParabol
struct VariableParabol

A simple and fast parametric easing function.

VariablePow
struct VariablePow

Parametric easing function using pow().

Templates

Pi
template Pi(int a, int b = 1)

Allows to represent fractions of PI without using the usual suffixes such as "two", "half", etc.

Meta