1 | In Java, additional mathematical operators are given in a package called Math as methods. These methods typically use arguments and results of type double. To compute exponents: |
2 | The API: public static double pow(double a, double b) |
3 | To use it: |
4 | Also: public static double sqrt (double a ) |
5 | And many more, such as sin, cos, min, max! |
6 | double x, y, z ; |
7 | x = 1.5 ; |
8 | y = 2.0 ; |
9 | z = Math.pow ( x, y ) ; |