Results 1 to 1 of 1
Thread: Math Class (ceil, floor, abs)
-
Math Class (ceil, floor, abs)
Math class is part of java.lang package and provides basic mathematical operations as shown in the example below:
Output:Java Code:double aNumber = -123.234; System.out.println("The absolute value of " + aNumber + " is " + Math.abs(aNumber)); System.out.println("The ceiling of " + aNumber + " is " + Math.ceil(aNumber)); System.out.println("The floor of " + aNumber + " is " + Math.floor(aNumber));
Java Code:The absolute value of -123.234 is 123.234 The ceiling of -123.234 is -123.0 The floor of -123.234 is -124.0
Similar Threads
-
Math Class
By ritwik07 in forum New To JavaReplies: 2Last Post: 09-14-2009, 04:06 PM -
Java Math
By levent in forum Java TutorialReplies: 1Last Post: 05-12-2008, 09:03 AM -
Math.Random
By Java Tip in forum Java TipReplies: 0Last Post: 11-23-2007, 02:09 PM -
Help with math in java
By fernando in forum New To JavaReplies: 1Last Post: 08-06-2007, 06:05 AM -
Date math
By orchid in forum New To JavaReplies: 2Last Post: 04-18-2007, 07:01 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks