Decimal.quantize

typeof(this) quantize( const typeof( this) rhs, ref DecimalContext ctx) const @safe pure nothrow @nogc

IEEE quantize: the result has the same exponent as rhs (its quantum), with the coefficient of this rounded there under the context. Underflow is suppressed per the specification. Signals INVALID_OPERATION (result NaN) when either operand is a one-sided infinity, when the target exponent is outside the format, or when the scaled coefficient would exceed the precision.