fma:Exception "Underflow" not set

赵爱南 zhaoainan163@163.com
Mon Mar 31 01:31:14 GMT 2025


> Hello:
> I'm nanzhu and a glibc developer, now I have a error in glibc2.34,below:
> FAIL:math/test-float-fma
> original exit status 1
> testing float (without inline functions)
> Failuer: fma (-0x8p-152, 0x8.8p-4, -0x3.fffff8p-128): Exception "Underflow" not set
> ...............................
> 
> 
> I think this result should not overflow. The calculation process is as follows:
> 
> 
> -0x8p-152  * 0x8.8p-4  - 0x3.fffff8p-128 
> 
> =-2^(-126)* 2^(-23) *(1+2^(-4))* 2^(-1)- 2^(-126)*(1-2^(-23))
> --2^(-126)*( 2^(-24) *(1+2^(-4))+ 1-2^(-23))
> =-2^(-126)*( 2^(-24) +2^(-28)+ 1-2^(-23))
> =-2^(-126)*( 1-2^(-24)+ 2^(-28))
> The result is rounded to the nearest nearest value and equals:-2^(-126)= 0xb810000000000000,No overflow occurred.
> 
> and  in  IEEE Std 754™-2019 :
> 
> "The operation fusedMultiplyAdd(x, y, z) computes (x×y)+z as if with unbounded range and
> 
> precision, rounding only once to the destination format."

<< I think you meant underflow here, and both x86 and aarch64 seems
<< to agree that this does underflow:

I know x86 and aarch64 are underflows in this situation, but I don't think this complies with IEEE Std 754 ™- 2019. There may be evidence to refute my calculation process.Thanks.









More information about the Libc-help mailing list