3 ms·
n is a 32-bit signed integer, as stated in the link.
by comex 13y ago
n is a 32-bit signed integer, as stated in the link.
- pfortuny 13y agoYes, 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.