fmod nan_mix usage

enh enh at google.com
Mon Jul 23 18:28:22 UTC 2018


the recent change from

  return (x*y)/(x*y);

to

  return nan_mix(x, y)/nan_mix(x, y);

in e_fmod.c broke some of our unit tests. for example, fmod(3.f, 0.f) in
one of the VM tests.

bionic/tests/math_test.cpp:(784) Failure in test
math_h_force_long_double.fmod
Value of: isnan(fmod(3.0, 0.0))
  Actual: false
Expected: true
math_h_force_long_double.fmod exited with exitcode 1.
[  FAILED  ] math_h_force_long_double.fmodf (13 ms)
bionic/tests/math_test.cpp:(798) Failure in test
math_h_force_long_double.fmodf
Value of: isnanf(fmodf(3.0f, 0.0f))
  Actual: false
Expected: true
math_h_force_long_double.fmodf exited with exitcode 1.
[  FAILED  ] math_h_force_long_double.fmodl (12 ms)
bionic/tests/math_test.cpp:(812) Failure in test
math_h_force_long_double.fmodl
Value of: isnanl(fmodl(3.0L, 0.0L))
  Actual: false
Expected: true

it looks like e_remainder.c might have the same issue, but Android's tests
didn't catch that :-( i'll improve the tests...


More information about the freebsd-numerics mailing list