Round to nearest or up?
-
-
-
So that's the basic functionality, but it goes much deeper. Why not the simple, obvious approach?
- 5 more replies
New conversation -
-
-
I guess the parentheses will lead to different behaviour depending on how big X is, with some loss of precision on the constants when X is big. Not sure why you'd want to do that, though.
-
So basically that choice of constants is carefully chosen so that it'll round down when x is the next representable number under 0.5, and adding two values near 0.25 avoids rounding up for values like 8388609.0, which you get from (x + 0.5).floor()
- 7 more replies
New conversation -
-
-
It makes me find bugs in Julia:https://github.com/JuliaLang/julia/issues/29698 …
-
Yes, it's about finding bugs in implementations of round(). I'm mostly going after Emscripten now and trying to make Rust faster, but if it solves a problem in Julia too, I'm stoked :)
End of conversation
New conversation -
-
-
Trying to very precisely determine whether the last bit of the floating point number X is set? I get that from first whiff as 0.24999994 smells very close to the IEEE floating point precision limit.
-
You're nearby the answer, maybe an epsilon or two away.
End of conversation
New conversation -
-
-
Determine which version of 754 you're using
-
Nope, but it might end up inadvertently having that effect if run on machines with 754 behavior significantly different than x86.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.