decimalCmp

fnint decimalCmp(long a, ubyte aScale, long b, ubyte bScale) @safe pure nothrow

The value-based three-way comparison of two coefficients at their own scales (the total order sort and min/max ride): negative when a < b, zero when equal, positive when a > b. An alignment overflow decides the order (the overflowing side's magnitude exceeds everything the other side can hold at the common scale).

Parameters

athe left coefficient
aScalethe left scale
bthe right coefficient
bScalethe right scale

Returns

< 0, 0 or > 0 as a compares to b.