Basic Math Demo : Math : Development Class : Java examples (example source code) Organized by topic

Java
C++
PHP
Java Home »  Development Class   » [  Math  ]  Screenshots 
 



Basic Math Demo



/* From http://java.sun.com/docs/books/tutorial/index.html */

public class BasicMathDemo {
    public static void main(String[] args) {
        double aNumber = -191.635;

        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));
        System.out.println("The rint of " + aNumber + " is " + Math.rint(aNumber));
    }
}

           
       
Related examples in the same category
1.  Absolute value
2.  Get the power value Get the power value
3.  Using the Math Trig Methods Using the Math Trig Methods
4.  Using BigDecimal for Precision Using BigDecimal for Precision
5.  Demonstrate our own version round() Demonstrate our own version round()
6.  Demonstrate a few of the Math functions for Trigonometry Demonstrate a few of the Math functions for Trigonometry
7.  Exponential Demo Exponential Demo
8.  Min Demo
9.  Using strict math in applications Using strict math in applications
10.  Conversion between polar and rectangular coordinates
11.  Using the pow() function
12.  Using strict math at the method level
13.  Caculating hyperbolic functions
14.  Caculating trigonometric functions
15.  Weighted floating-pioint comparisons
16.  Solving right triangles
17.  Applying the quadratic formula
18.  Trigonometric Demo Trigonometric Demo
19.  Complex Number Demo
























Home| Contact Us
Copyright 2003 - 04 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.