java math ceil round up decimal

www‮iruttual.‬.com
java math ceil round up decimal
/**
 * @author lautturi.com 
 * Java example: java ceil decimals round up double number
 */

import java.util.*;

public class Lautturi {

	public static void main(String[] args) {

		double d = 3.14159;
		int n = (int) Math.ceil(d);
		System.out.println("double: " + d);
		System.out.println("int: " + n);

	}
}

output:

double: 3.14159
int: 4
Created Time:2017-09-27 00:51:35  Author:lautturi