This post originated from an RSS feed registered with Java Buzz
by Arpit Mandliya.
Original Post: Java Math ceil example
Feed Title: Java tutorial for beginners
Feed URL: http://feeds.feedburner.com/arpitmandliyasblog
Feed Description: A blog about java programming language and its frameworks
Java math ceil function is used to get smallest integer which is greater than number. Real life example Let’s say a telephone company charges you 1 dollar per minute. When you talk to someone for 1 minute 5 seconds, it will still charge you 2 dollar for that call. So telephone company can use Math.ceil function to get 2 minutes from 1 minutes 5 seconds. Syntax Example Let’s use math’s ceil function in the example. When you run above program, output of the program will be: Ceil value for 2.6 = 3.0 Ceil value for 26.1 = 27.0