__d64_test_significance, __d128_test_significance

Purpose

Test Significance

Checks whether a decimal floating-point value has a specified number of digits of significance.

Prototype

long __d64_test_significance (_Decimal64, unsigned long digits);

long __d128_test_significance (_Decimal128, unsigned long digits);

Parameters

digits
The number of digits of significance to be tested for. digits must be in the range 0 to 63; otherwise the result is undefined. If it is 0, all values including zero will be considered to have more significant digits, if it is not 0, a zero value will be considered to have fewer significant digits.

Return value

Returns the following values:
  • Less than 0 if the number of digits of significance of the first parameter is less than the second parameter.
  • 0 if the number of digits of significance is the same as the second parameter.
  • Greater than 0 if the number of digits of significance of the first parameter is greater than that of the second parameter or digits is 0.
  • -2 if either parameter is a quiet or signaling NaN or positive or negative infinity.

For these functions, the number of significant digits of the value 0 is considered to be zero.