fdim

Returns the positive difference between x and y. If x ≤ y, retuns 0.0

fdim
(
D1
D2
)
(
auto const ref D1 x
,
auto const ref D2 y
)

Throws

InvalidOperationExceptioneither x or y is signaling NaN
UnderflowExceptionresult is subnormal
InexactExceptionresult is inexact

Special values

xyfdim(x, y)
NaNanyNaN
anyNaNNaN
x > yx - y
x ≤ y0.0

Examples

decimal32 x = "10.4";
decimal32 y = "7.3";

assert (fdim(x, y) == decimal32("3.1"));
assert (fdim(y, x) == 0);

Meta