Is there a way to find the ceiling or floor of a float for example
4.5 -> 4 for floor
4.5 -> 5 for ceiling
Printable View
Is there a way to find the ceiling or floor of a float for example
4.5 -> 4 for floor
4.5 -> 5 for ceiling
I'm guessing this is for an assignment (otherwise the no Math is a weird requirement). You could peek at the Math.java source. Or consider what foo%1 is when foo is a floating point type.