std.math.algebraic

This is a submodule of std.math.

It contains classical algebraic functions like abs, sqrt, and poly.

Types 1

private enumPowType
floor
ceil

Functions 20

fnauto abs(Num)(Num x) if (isIntegral!Num || (is(typeof(Num.init >= 0)) && is(typeof(- Num.init)))) @nogc nothrow pureCalculates the absolute value of a number.
fnreal fabs(real x) @safe pure nothrow @nogcReturns |x|
fndouble fabs(double x) @safe pure nothrow @nogcditto
fnfloat fabs(float x) @safe pure nothrow @nogcditto
fnfloat sqrt(float x) @nogc @safe pure nothrowCompute square root of x.
fndouble sqrt(double x) @nogc @safe pure nothrowditto
fnreal sqrt(real x) @nogc @safe pure nothrowditto
fnreal cbrt(real x) @trusted pure nothrow @nogcCalculates the cube root of x.
fnT hypot(T)(const T x, const T y) if (isFloatingPoint!T) @safe pure nothrow @nogcCalculates the length of the hypotenuse of a right-angled triangle with sides of length x and y. The hypotenuse is the value of the square root of the sums of the squares of x and y:
fnT hypot(T)(const T x, const T y, const T z) if (isFloatingPoint!T) @safe pure nothrow @nogcCalculates the distance of the point (x, y, z) from the origin (0, 0, 0) in three-dimensional space. The distance is the value of the square root of the sums of the squares of x, y, and z:
fnUnqual!(CommonType!(T1, T2)) poly(T1, T2)(T1 x, in T2[] A) if (isFloatingPoint!T1 && isFloatingPoint!T2) @trusted pure nothrow @nogcEvaluate polynomial A(x) = a + ax + ax + ax; ...
fnUnqual!(CommonType!(T1, T2)) poly(T1, T2, int N)(T1 x, ref const T2[N] A) if (isFloatingPoint!T1 && isFloatingPoint!T2 && N > 0 && N <= 10) @safe pure nothrow @nogcditto
private fnUnqual!(CommonType!(T1, T2)) polyImplBase(T1, T2)(T1 x, in T2[] A) if (isFloatingPoint!T1 && isFloatingPoint!T2) @trusted pure nothrow @nogc
private fnreal polyImpl(real x, in real[] A) @trusted pure nothrow @nogc
fnT nextPow2(T)(const T val) if (isIntegral!T)Gives the next power of two after `val`. `T` can be any built-in numerical type.
fnT nextPow2(T)(const T val) if (isFloatingPoint!T)ditto
fnT truncPow2(T)(const T val) if (isIntegral!T)Gives the last power of two before `val`. can be any built-in numerical type.
fnT truncPow2(T)(const T val) if (isFloatingPoint!T)ditto
private fnT powIntegralImpl(PowType type, T)(T val)
private fnT powFloatingPointImpl(PowType type, T)(T x)