The limit 2^19 (524288) seems needlessly conservative here. Optim should work fine for all integers up to 2^22?https://godbolt.org/g/HXm2sE
-
-
If the constant factor is an integer that occupies only 22 bits of the significand, then the product is exact… 1/2
-
Then it either overflows on conversion to int, which is UB, or doesn't, and then the result is the same as the int multiplication.
-
(22 because the int argument is converted to a floating-point number with 31-bit precision. 53 - 31 = 22)
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.