Decimal.opCmp

-Infinity is less than all numbers, -NaN is greater than -Infinity but less than all other numbers, NaN is greater than -NaN but less than all other numbers and Infinity is greater than all numbers. -NaN and NaN are equal to themselves.

struct Decimal(Hook = Abort)
const
int
opCmp
(
T
)
(
T d
)
if (
isNumeric!T ||
isInstanceOf!(TemplateOf!(Decimal), T)
)

Parameters

d T

the decimal or built-in number to compare to

Return Value

Type: int

Barring special values, 0 if subtracting the two numbers yields 0, -1 if the result is less than 0, and 1 if the result is greater than zero

Meta