Re:[Stack Overflow]Design a function f, such that f(f(n)) ==...
by comex on Tuesday June 25, 2013 @03:15AM
(#5938018)
n is a 32-bit signed integer, as stated in the link.
[ Parent
| on HN ]
Re:[Stack Overflow]Design a function f, such that f(f(n)) ==...
by pfortuny on Tuesday June 25, 2013 @12:50PM
(#5940730)
Yes, my formula is easily transformed for 32-bit integers with sign. Not that difficult.
I leave that as an exercise to the reader. :-)
Re:[Stack Overflow]Design a function f, such that f(f(n)) ==...
by comex on Tuesday June 25, 2013 @04:13PM
(#5942116)
It 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.