Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I know about nothing about PyPy internals but

  case float_abs(_):
  -          return float
  +          return float.with_range(low=0, high=None)
to me, looks like a risky change. I would fear this could introduce a bug when computing

  isNaN(abs(NaN))
That should return true, but with that change, I fear it could return false because it informs the optimizer that abs never returns a NaN.


That shouldn't mean that it doesn't return a NaN. Things are generally not optimized away because of NaNs. E.g. in GCC, abs(c) > -1.0 is not folded, unless building with -ffast-math


Where'd you get that patch from? I can't find it in the blog post.

EDIT: Ah, other comment mentions article was edited.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: