Round up double to long in Java

double, java, long-integer, rounding

Solution

Math.ceil returns a double according to this, so you should just be able to cast it to a long after calling math.ceil(double).

Problem

Is there a method in java which round up double to Long in java? eg. double d=2394867326.23; I need to round this up to 2394867327. The result is not an integer, so I think cannot use Math.ceil. Do we have a method in java which return the Long instead of int?

Original source

Related problems