Are there positive ints a,b s.t. floor((double)a/b)!=a/b ? (C expressions, 32-bit int)
BTW is that still true if a,b can range up to 53 bit? Looks borderline but probably still safe.
-
-
Yes, as long as a and b convert exactly you’re fine.
-
(2^54 - 2)/(2^54 - 1) is >1 ulp away from 1.0 so that looks ok.
-
2^54 - 1 isn't representable as a double; are you sure you don't mean 2^53 - 1?
-
Indeed, 2^53 - 1.
-
The >1ulp bound is clear converting the division to geometric series, treating denominator as 1-x.
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.