ITADN

-Werror=float-equal is triggered when using !val to complare floting point values

#184ClosedForchapeatl 创建于 2025-04-26
F
Forchapeatlcommented
The use of the `-Werror=float-equal` flag, which causes all warnings related to floating-point comparisons `(==` or ` !=`) to be treated as errors. In C and C++ programming, comparing floating-point values directly using equality (e.g., `==` or` !=`) is generally not safe due to the precision issues inherent in floating-point representation. Looking at the` ulp.c` file, we can see that it is comparing floating-point values with `== `and `!=` directly, which is causing the warnings and errors related to unsafe floating-point comparisons. ![Image](https://github.com/user-attachments/assets/1f4089fb-bd17-46c1-a06e-20e900d84cea)
关闭于 2025-04-29 0 条评论