std.math - D Programming Language (original) (raw)
Contains the elementary mathematical functions (powers, roots, and trigonometric functions), and low-level floating-point operations. Mathematical special functions are available in std.mathspecial.
The functionality closely follows the IEEE754-2008 standard for floating-point arithmetic, including the use of camelCase names rather than C99-style lower case names. All of these functions behave correctly when presented with an infinity or NaN.
The following IEEE 'real' formats are currently supported:
- 64 bit Big-endian 'double' (eg PowerPC)
- 128 bit Big-endian 'quadruple' (eg SPARC)
- 64 bit Little-endian 'double' (eg x86-SSE2)
- 80 bit Little-endian, with implied bit 'real80' (eg x87, Itanium)
- 128 bit Little-endian 'quadruple' (not implemented on any known processor!)
- Non-IEEE 128 bit Big-endian 'doubledouble' (eg PowerPC) has partial support
Unlike C, there is no global 'errno' variable. Consequently, almost all of these functions are pure nothrow.
Walter Bright, Don Clugston, Conversion of CEPHES math library to D by Iain Buclaw and David Nadlinger
Copyright © 1999-2025 by the D Language Foundation | Page generated byDdoc on Fri Oct 10 22:10:47 2025