Decimal

Decimal floating-point computer numbering format that occupies 4, 8 or 16 bytes in computer memory.

Constructors

this
this(T value)

Constructs a Decimal data type using the specified _value

Members

Functions

opAssign
auto ref opAssign(T value)

Implementation of assignnment operator. It supports the same semantics as the constructor.

opBinary
auto opBinary(T value)
opBinaryRight
auto opBinaryRight(T value)

Implementation of binary and assignment operators (+, -, *, /, %, ^^).

opCast
T opCast()

Implementation of cast operator. Supported casts: integral, floating point, _decimal, char, bool Exceptions:

Data typeInvalidOverflowUnderflowInexact
integral
char
float
bool
decimal
opCmp
float opCmp(T value)

Implementation of comparison operator. Supported types : _decimal, floating point, integral, char

thisValueResultInvalid
NaNanyNaN
anyNaNNaN
anyany±1.0, 0.0
opEquals
bool opEquals(T value)

Implementation of == operator. This operation is silent, no exceptions are thrown. Supported types : _decimal, floating point, integral, char

opOpAssign
auto opOpAssign(T value)

Implementation of binary and assignment operators (+, -, *, /, %, ^^).

opUnary
auto opUnary()

Implementation of +/- unary operators. These operations are silent, no exceptions are thrown

opUnary
auto ref opUnary()

Implementation of ++/-- unary operators. Exceptions:

Value++/--InvalidOverflowInexact
NaNNaN
±∞±∞
anyany
toHash
size_t toHash()

Returns a unique hash of the _decimal value suitable for use in a hash table. Notes: This function is not intended for direct use, it's provided as support for associative arrays.

toString
void toString(void delegate(const(C)[]) sink, FormatSpec!C fmt)
void toString(void delegate(const(C)[]) sink)

Converts current value to string, passing it to the given sink using the specified format.

toString
string toString(FormatSpec!C fmt)

Converts current value to string according to the format specification

toString
string toString()

Converts current value to string in floating point or scientific notation,which one is shorter.

toString
string toString(const(C)[] fmt)

Converts current value to string according to the format specification

Manifest constants

E
enum E;

Undocumented in source.

LN10
enum LN10;

Undocumented in source.

LN2
enum LN2;

Undocumented in source.

LOG10E
enum LOG10E;

Undocumented in source.

LOG2
enum LOG2;

Undocumented in source.

LOG2E
enum LOG2E;

Undocumented in source.

LOG2T
enum LOG2T;

Undocumented in source.

M_1_PI
enum M_1_PI;

Undocumented in source.

M_2_PI
enum M_2_PI;

Undocumented in source.

M_2_SQRTPI
enum M_2_SQRTPI;

Undocumented in source.

PI
enum PI;

Undocumented in source.

PI_2
enum PI_2;

Undocumented in source.

PI_4
enum PI_4;

Undocumented in source.

SQRT1_2
enum SQRT1_2;

Undocumented in source.

SQRT2
enum SQRT2;

Undocumented in source.

dig
enum dig;

Undocumented in source.

epsilon
enum epsilon;

Undocumented in source.

infinity
enum infinity;

Undocumented in source.

mant_dig
enum mant_dig;

Undocumented in source.

max
enum max;

Undocumented in source.

max_10_exp
enum max_10_exp;

Undocumented in source.

max_exp
enum max_exp;

Undocumented in source.

min_10_exp
enum min_10_exp;

Undocumented in source.

min_exp
enum min_exp;

Undocumented in source.

min_normal
enum min_normal;

Undocumented in source.

nan
enum nan;

Undocumented in source.

radix
enum radix;

always 10 for _decimal data types

Meta