mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
math: fix failing test on FreeBSD with gcc 12.2.0 (and -ffast-math) (#19278)
This commit is contained in:
parent
639f128c1b
commit
3e93a13ed8
5 changed files with 68 additions and 21 deletions
|
@ -29,6 +29,11 @@ pub fn nan() f64 {
|
|||
|
||||
// is_nan reports whether f is an IEEE 754 ``not-a-number'' value.
|
||||
pub fn is_nan(f f64) bool {
|
||||
$if fast_math {
|
||||
if f64_bits(f) == math.uvnan {
|
||||
return true
|
||||
}
|
||||
}
|
||||
// IEEE 754 says that only NaNs satisfy f != f.
|
||||
// To avoid the floating-point hardware, could use:
|
||||
// x := f64_bits(f);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue