Question: ```
int total = (int) Math.ceil(157/32);

```

Why does it still return 4? `157/32 = 4.90625`, I need to round up, I've looked around and this seems to be the right method.

I tried `total` as `double` type, but get 4.0.

What am I doing wrong?

Answer: 
In Java adding a .0 will make it a double...

```
int total = (int) Math.ceil(157.0 / 32.0);

```
There are two methods by which you can round up your double value.

1. *Math.ceil*
2. *Math.floor*

If you want your answer 4.90625 as 4 then you should use Math.floor and if you want your answer 4.90625 as 5 then you can use Math.ceil

You can refer following code for that.

```
public class TestClass {

    public static void main(String[] args) {
        int floorValue = (int) Math.floor((double)157 / 32);
        int ceilValue = (int) Math.ceil((double)157 / 32);
        System.out.println("Floor: "+floorValue);
        System.out.println("Ceil: "+ceilValue);

    }

}

```