isIdentical

Checks if two _decimal values are identical

bool
isIdentical
(
D
)
(
auto const ref D x
,
auto const ref D y
)

Parameters

x D

a _decimal value

y D

a _decimal value

Return Value

Type: bool

true if x has the same internal representation as y Notes: Even if two _decimal values are equal, their internal representation can be different:<br/> - NaN values must have the same sign and the same payload to be considered identical; NaN(12) is not identical to NaN(13)<br/> - Zero values must have the same sign and the same exponent to be considered identical; 0 * 103 is not identical to 0 * 105<br/> - Finite _values must be represented based on same exponent to be considered identical; 123 * 10-3 is not identical to 1.23 * 10-1

Examples

assert (isIdentical(decimal32.min_normal, decimal32.min_normal));
assert (!isIdentical(decimal64("nan"), decimal64("nan<200>")));

Meta