quantize

Express a value using another value exponent

@IEEECompliant("quantize", 18)
D1
quantize
(
D1
D2
)
(
auto const ref D1 x
,
auto const ref D2 y
)
if (
isDecimal!(D1, D2)
)

Parameters

x D1

source value

y D2

value used as exponent source

Return Value

Type: D1

a value with the same numerical value as x but with the exponent of y

Throws

InvalidOperationExceptionx is signaling NaN
InvalidOperationExceptiononly one of x or y is ±∞
InexactExceptionresult is inexact

Special values

xyquantize(x, y)
NaNanyNaN
anyNaNNaN
±∞±∞±∞
±∞anyNaN
any±∞NaN

Meta