PHP, 51 45 43 37 characters
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.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.