Decimal.opAssign

Changes the value of this decimal to the value of a built-in number. Also resets all exceptional condition flags.

struct Decimal(Hook = Abort)
opAssign
(
T
)
(
T num
)
if (
isNumeric!T
)

Parameters

num T

the number to convert to exact decimal

Note: Using float types for construction is less accurate than using a string representation due to floating point inaccuracy. If possible, it's always better to use string construction.

Meta