I need a rounding function that returns a larger integer when the input is positive and the a smaller number when negative, i.e. it should not return 0 unless the input is actually 0.0.
Examples:
f(0.1) = 1
f(-0.1) = -1
f(0.0) = 0
(The Math.ceil() function always rounds up, so Math.ceil(-0.1) = 0
How about
That rounds the absolute value of your number up, then re-applies the signum.