Packages This Package Prev Next Index
public final class java.lang.Math extends java.lang.Object (I-§1.12) { // Fields public final static double E; §1.10.1 public final static double PI; §1.10.2 // Methods public static double abs(double a); §1.10.3 public static float abs(float a); §1.10.4 public static int abs(int a); §1.10.5 public static long abs(long a); §1.10.6 public static double acos(double a); §1.10.7 public static double asin(double a); §1.10.8 public static double atan(double a); §1.10.9 public static double atan2(double a, double b); §1.10.10 public static double ceil(double a); §1.10.11 public static double cos(double a); §1.10.12 public static double exp(double a); §1.10.13 public static double floor(double a); §1.10.14 public static double §1.10.15 IEEEremainder(double f1, double f2); public static double log(double a); §1.10.16 public static double max(double a, double b); §1.10.17 public static float max(float a, float b); §1.10.18 public static int max(int a, int b); §1.10.19 public static long max(long a, long b); §1.10.20 public static double min(double a, double b); §1.10.21 public static float min(float a, float b); §1.10.22 public static int min(int a, int b); §1.10.23 public static long min(long a, long b); §1.10.24 public static double pow(double a, double b); §1.10.25 public static double random(); §1.10.26 public static double rint(double a); §1.10.27 public static long round(double a); §1.10.28 public static int round(float a); §1.10.29 public static double sin(double a); §1.10.30 public static double sqrt(double a); §1.10.31 public static double tan(double a); §1.10.32 }The class Math contains methods for performing basic numerical operations such as the elementary exponential, logarithm, square root, and trigononetric functions.
public final static double E = 2.7182818284590452354
public final static double PI = 3.14159265358979323846
public static double abs(double a)
a
-
a double value
public static float abs(float a)
a
-
public static int abs(int a)
a
-
public static long abs(long a)
a
-
a long value.
public static double acos(double a)
a
-
a double value
public static double asin(double a)
a
-
a double value
public static double atan(double a)
a
-
a double value
public static double atan2(double a, double b)
a
-
a double value
b
-
a double value
public static double ceil(double a)
a
-
a double value
public static double cos(double a)
a
-
an angle, in radians.
public static double exp(double a)
a
-
a double value
public static double floor(double a)
a
-
a double value
a
-
an assigned value
public static double IEEEremainder(double f1, double f2)
f1
-
the dividend
f2
-
the divisor
public static double log(double a)3
a
-
a number greater than 0.0
public static double max(double a, double b)
a
-
a double value
b
-
a double value
public static float max(float a, float b)
a
-
a float value
b
-
a float value
public static int max(int a, int b)
a
-
an int value
b
-
an int value
public static long max(long a, long b)
a
-
a long value
b
-
a long value
public static double min(double a, double b)
a
-
a double value
b
-
a double value
public static float min(float a, float b)
a
-
a float value
b
-
a float value
public static int min(int a, int b)
a
-
an int value
b
-
an int value
public static long min(long a, long b)
a
-
a long value
b
-
a long value
public static double pow(double a, double b)8
a
-
a double value
b
-
a double value
public static double random()
public static double rint(double a)
a
-
a double value
public static long round(double a)
a
-
a double value
public static int round(float a)
a
-
a float value
public static double sin(double a)
a
-
a double value
public static double sqrt(double a)9
a
-
a double value
public static double tan(double a)
a
-
a double value
2 In Java 1.0, abs(-0.0f) returns -0.0f. This bug is fixed in Java 1.1.
3 In Java 1.0, the method log was declared as follows
public static log sqrt(double a)
throws ArithmeticException
even though the ArithmeticException was never thrown. This bug is fixed in Java 1.1.
4 In Java 1.0, max(-0.0, 0.0) returns -0.0. This bug is fixed in Java 1.1.
5 In Java 1.0, max(-0.0f, 0.0f) returns -0.0f. This bug is fixed in Java 1.1.
6 In Java 1.0, min(0.0, -0.0) returns 0.0. This bug is fixed in Java 1.1.
7 In Java 1.0, min(0.0f, -0.0f) returns 0.0f. This bug is fixed in Java 1.1.
8 In Java 1.0, the method pow was declared as follows
public static double sqrt(double a, double b)
throws ArithmeticException
even though the ArithmeticException was never thrown. This bug is fixed in Java 1.1.
9 In Java 1.0, the method sqrt was declared as follows
public static double sqrt(double a)
throws ArithmeticException
even though the ArithmeticException was never thrown. This bug is fixed in Java 1.1.
Packages This Package Prev Next IndexJava API Document (HTML generated by dkramer on April 22, 1996)