View source code
Display the source code in std/math/operations.d from which this page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone.

Module std.math.operations

This is a submodule of std.math.

It contains several functions for work with floating point numbers.

Functions

NameDescription
approxEqual(value, reference, maxRelDiff, maxAbsDiff) Computes whether a values is approximately equal to a reference value, admitting a maximum relative difference, and a maximum absolute difference.
cmp(x, y) Defines a total order on all floating-point numbers.
fdim(x, y) Returns the positive difference between x and y.
feqrel(x, y) To what precision is x equal to y?
fma(x, y, z) Returns (x * y) + z, rounding only once according to the current rounding mode.
fmax(x, y) Returns the larger of x and y.
fmin(x, y) Returns the smaller of x and y.
getNaNPayload(x) Extract an integral payload from a NAN.
isClose(lhs, rhs, maxRelDiff, maxAbsDiff) Computes whether two values are approximately equal, admitting a maximum relative difference, and a maximum absolute difference.
NaN(payload) Create a quiet NAN, storing an integer inside the payload.
nextafter(x, y) Calculates the next representable value after x in the direction of y.
nextDown(x) Calculate the next smallest floating point value before x.
nextUp(x) Calculate the next largest floating point value after x.

Authors

Walter Bright, Don Clugston, Conversion of CEPHES math library to D by Iain Buclaw and David Nadlinger

License

Boost License 1.0.