PHP,
function f($n){return~~$n-(~~$n>$n);} This should be able to be applied to most languages that do not support the n%1 trick.
Kevin Brown-Silva
- 6.5k
- 5
- 42
- 59