__d64_compare_signaling, __d128_compare_signaling

Purpose

Compare Signaling Exception on NaN

Compares two decimal floating-point values and raises an Invalid Operation exception if either is a quiet or signaling NaN.

Prototype

long __d64_compare_signaling (_Decimal64, _Decimal64);

long __d128_compare_signaling (_Decimal128, _Decimal128);

Return value

Returns the following values:
  • Less than 0 if the value of the first parameter is less than the value of the second parameter.
  • 0 if both parameters have the same value.
  • Greater than 0 if the value of the first parameter is greater than the value of the second parameter.
If either value is a quiet or signalling NaN, an exception is raised. If no exception handler has been enabled to trap the exception, the function returns -2.

Usage

If either value is a NaN, normal comparisons using the relational operators (==, !=, <, <=, > and >=) always return false, which raises an exception for a signaling NaN but not for a quiet NaN. If you want an exception to be raised when either value is a quiet or signaling NaN, you should use the Compare Signaling Exception on NaN built-in functions instead of a relational operator.