Decimal

A floating-point decimal number.

The number consists of: A boolean sign A integer-type coefficient, An integer exponent A tag for special values (NaN, infinity)

Constructors

this
this(bool value)

Constructs a decimal number from a boolean value. false == 0, true == 1

this
this(string str)
Undocumented in source.
this
this(U r)
Undocumented in source.
this
this(U coefficient)
Undocumented in source.
this
this(U coefficient)
Undocumented in source.
this
this(D that)
Undocumented in source.
this
this(U coefficient, int exponent)

Constructs a number from a boolean sign, an integer coefficient and an optional integer exponent. The sign of the number is the value of the sign parameter regardless of the sign of the coefficient. The intial precision of the number is deduced from the number of decimal digits in the coefficient.

this
this(U coefficient, int exponent, bool sign)
Undocumented in source.

Members

Aliases

D
alias D = Decimal!(context)
Undocumented in source.
decimal
alias decimal = Decimal!(context)
Undocumented in source.

Enums

IsDecimal
enum IsDecimal
Undocumented in source.

Manifest constants

maxAdjustedExpo
enum maxAdjustedExpo;

maximum value of the adjusted exponent.

maxCoefficient
enum maxCoefficient;

maximum value of the coefficient.

maxExpo
enum maxExpo;

maximum value of the exponent.

minExpo
enum minExpo;

smallest normalized exponent.

precision
enum precision;

the maximum length of the coefficient in decimal .

tinyExpo
enum tinyExpo;

smallest non-normalized exponent.

Properties

adjExpo
int adjExpo [@property getter]

Returns the adjusted exponent of this number

coff
BigInt coff [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
coff
BigInt coff [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
coff
long coff [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
digits
int digits [@property getter]

Returns the number of decimal digits in the coefficient of this number

digits
int digits [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
expo
int expo [@property getter]

Returns the exponent of this number

expo
int expo [@property setter]

sets the exponent of this number

sign
bool sign [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
sign
bool sign [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

infinity
D infinity(bool sign)

Returns infinity.

init
D init()

Returns the default value for this type (NaN)

max
D max()

Returns the maximum representable normal value in the current context.

nan
D nan(ushort payload, bool sign)

Returns NaN

snan
D snan(ushort payload, bool sign)

Returns signaling NaN

Variables

FIVE
enum D FIVE;
Undocumented in source.
HALF
enum D HALF;
Undocumented in source.
NEG_ONE
enum D NEG_ONE;
Undocumented in source.
NEG_ZRO
enum D NEG_ZRO;
Undocumented in source.
ONE
enum D ONE;
Undocumented in source.
TEN
enum D TEN;
Undocumented in source.
TWO
enum D TWO;
Undocumented in source.
ZERO
enum D ZERO;
Undocumented in source.
context
enum Context context;
Undocumented in source.
min
enum D min;

Returns the minimum representable subnormal value in this context.

min_normal
enum D min_normal;

Returns the minimum representable normal value in this context.

mode
enum Round mode;

rounding mode.

radix
enum int radix;

Returns the radix, which is always ten for D numbers.

Meta