Here you can find the source of roundAway(double d)
public static int roundAway(double d)
//package com.java2s; //License from project: LGPL public class Main { public static int roundAway(double d) { return (int) (d < 0 ? Math.floor(d) : Math.ceil(d)); }// w w w. j a v a 2 s. co m }