The OpenD Programming Language

std.math

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.

Modules

algebraic
module std.math.algebraic

This is a submodule of std.math.

constants
module std.math.constants

This is a submodule of std.math.

exponential
module std.math.exponential

This is a submodule of std.math.

hardware
module std.math.hardware

This is a submodule of std.math.

operations
module std.math.operations

This is a submodule of std.math.

remainder
module std.math.remainder

This is a submodule of std.math.

rounding
module std.math.rounding

This is a submodule of std.math.

traits
module std.math.traits

This is a submodule of std.math.

trigonometry
module std.math.trigonometry

This is a submodule of std.math.

Public Imports

std.math.algebraic
public import std.math.algebraic;
Undocumented in source.
std.math.constants
public import std.math.constants;
Undocumented in source.
std.math.exponential
public import std.math.exponential;
Undocumented in source.
std.math.operations
public import std.math.operations;
Undocumented in source.
std.math.hardware
public import std.math.hardware;
Undocumented in source.
std.math.remainder
real remainder(real x, real y) via public import std.math.remainder;

Calculate the remainder x REM y, following IEC 60559.

std.math.rounding
public import std.math.rounding;
Undocumented in source.
std.math.traits
public import std.math.traits;
Undocumented in source.
std.math.trigonometry
public import std.math.trigonometry;
Undocumented in source.

Meta

Authors

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