Skip to main content
1 of 5
Kevin Brown-Silva
  • 6.5k
  • 5
  • 42
  • 59

PHP, 54 characters

$n?(int)$n-1:(int)$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