.. _std_math: .. highlight:: d std.math -------- .. c:namespace:: std.math Module entries: :func:`abs`, :func:`abs`, :func:`abs`, :func:`acos`, :func:`asin`, :func:`atan2`, :func:`ceil`, :func:`cos`, :func:`exp`, :func:`fmod`, :func:`max`, :func:`max`, :func:`max`, :func:`max`, :func:`min`, :func:`min`, :func:`min`, :func:`min`, :func:`pow`, :func:`sin`, :func:`sqrt`, :func:`tan`, :func:`trunc` .. function:: abs(i) `int abs(int i)` Returns the absolute (ie. positive) value of the parameter. .. function:: abs(f) `float abs(float f)` Returns the absolute (ie. positive) value of the parameter. .. function:: abs(d) `double abs(double d)` Returns the absolute (ie. positive) value of the parameter. .. function:: acos(f) `float acos(float f)` Returns the arc cosine of the parameter. .. function:: asin(f) `float asin(float f)` TODO: document .. function:: atan2(y, x) `float atan2(float y, float x)` Returns the arc tangent of y/x. This is the angle between a point (x, y) and the X axis. .. function:: ceil(x) `float ceil(float x)` TODO: document .. function:: cos(f) `float cos(float f)` Returns the cosine of the parameter in radians. .. function:: exp(f) `float exp(float f)` Returns the exponential value of the parameter. .. function:: fmod(x, y) `float fmod(float x, float y)` TODO: document .. function:: max(a, b) `double max(double a, double b)` Returns the maximum of `a` and `b`. Example:: assert(max(2, 3) == 3); assert(max(-4.5, -5.0) == -4.5); .. function:: max(a, b) `int max(int a, int b)` Returns the maximum of `a` and `b`. .. function:: max(a, b) `long max(long a, long b)` Returns the maximum of `a` and `b`. .. function:: max(a, b) `float max(float a, float b)` Returns the maximum of `a` and `b`. .. function:: min(a, b) `double min(double a, double b)` Returns the minimum of `a` and `b`. Example:: assert(min(2, 3) == 2); assert(min(-4.5, -5.0) == -5); .. function:: min(a, b) `float min(float a, float b)` Returns the minimum of `a` and `b`. .. function:: min(a, b) `long min(long a, long b)` Returns the minimum of `a` and `b`. .. function:: min(a, b) `int min(int a, int b)` Returns the minimum of `a` and `b`. .. function:: pow(x, y) `float pow(float x, float y)` Returns `x` raised to the power of `y`. .. function:: sin(f) `float sin(float f)` Returns the sine of the parameter in radians. .. function:: sqrt(f) `float sqrt(float f)` Returns the square root of f. .. function:: tan(f) `float tan(float f)` Returns the tangent of the parameter in radians. .. function:: trunc(x) `float trunc(float x)` TODO: document