3 ms·
Yes, my formula is easily transformed for 32-bit integers with sign. Not that difficult. I leave that as an exercise to the reader. :-)
by pfortuny 13y ago
Yes, my formula is easily transformed for 32-bit integers with sign. Not that difficult.
I leave that as an exercise to the reader. :-)
- comex 13y agoIt is not "not that difficult": as one of the answers explained, it is impossible to create such a function that works for all values - not just -2147483648, which obviously cannot comply, but in your case, also 2147483647.