View source code
Display the source code in std/math/traits.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.traits

This is a submodule of std.math.

It contains several functions for introspection on numerical values.

Functions

NameDescription
copysign(to, from)
isFinite(x) Determines if x is finite.
isIdentical(x, y) Is the binary representation of x identical to y?
isInfinity(x) Determines if x is ±∞.
isNaN(x) Determines if x is NaN.
isNormal(x) Determines if x is normalized.
isPowerOf2(x) Check whether a number is an integer power of two.
isSubnormal(x) Determines if x is subnormal.
sgn(x) Returns -1 if x < 0, x if x == 0, 1 if x > 0, and NAN if x==NAN.
signbit(x) Return 1 if sign bit of e is set, 0 if not.

Authors

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

License

Boost License 1.0.