Integer type (typically 4 bytes, -2,147,483,648 to 2,147,483,647)
Read about return values of samequantumd32 function .
1st Parameter Type : float
Single-precision floating point (±3.4E±38, ~7 decimal digits)
1st Parameter
The first 32-bit floating-point value to compare.
2nd Parameter Type : float
Single-precision floating point (±3.4E±38, ~7 decimal digits)
2nd Parameter
The second 32-bit floating-point value to compare.
3rd Parameter Type : float
Single-precision floating point (±3.4E±38, ~7 decimal digits)
3rd Parameter
The quantum value defining the precision threshold for comparison.
Read more about parameters of samequantumd32 in parameters section
The samequantumd32function in C language Checks if two _Decimal32 numbers have the same quantization (exponent). Note: This is part of the optional decimal floating-point arithmetic support.
The samequantumd32 function determines whether two _Decimal32 numbers have the same quantum exponent. This is useful for ensuring that decimal numbers have the same precision, which is particularly important in financial calculations where consistent decimal places are required.
The samequantumd32function takes 3
parameters:
•
float `value1`: The first 32-bit floating-point value to compare.
•
float `value2`: The second 32-bit floating-point value to compare.
•
float `quantum`: The quantum value defining the precision threshold for comparison.
Checks if the two 32-bit floating-point values `value1` and `value2` fall within the same quantum level, defined by the precision threshold `quantum`. Returns `1` if the values are in the same quantum level, or `0` otherwise. Useful for precision-aware comparisons in numerical computations.
The samequantumd32 function return value :
Returns a non-zero value (true) if x and y have the same quantum exponent, 0 (false) otherwise
Output
This example demonstrates how samequantumd32 can be used to compare the quantum exponents of different _Decimal32 numbers.