Classe java.lang.Math


The class Math contains methods for performing basic numeric operations such as the elementary exponential, logarithm, square root, and trigonometric functions.

To help ensure portability of Java programs, the definitions of many of the numeric functions in this package require that they produce the same results as certain published algorithms. These algorithms are available from the well-known network library netlib as the package "Freely Distributable Math Library" (fdlibm). These algorithms, which are written in the C programming language, are then to be understood as executed with all floating-point operations following the rules of Java floating-point arithmetic.

The network library may be found on the World Wide Web at

then perform a keyword search for "fdlibm".

The Java math library is defined with respect to the version of fdlibm dated January 4, 1995. Where fdlibm provides more than one definition for a function (such as acos), use the "IEEE 754 core function" version (residing in a file whose name begins with the letter e).

Cette classe ne peut être instanciée.

	package java.lang;

	import java.util.Random;

		(>JDK1.0)public final
	class Math {

	    // Constantes et champs protégés
		(>JDK1.0)    public static final double E = 2.7182818284590452354;
		(>JDK1.0)    public static final double PI = 3.14159265358979323846;

	    // Méthodes de classe publiques
		(>JDK1.0)    public static double abs(double a);
		(>JDK1.0)    public static float abs(float a);
		(>JDK1.0)    public static int abs(int a);
		(>JDK1.0)    public static long abs(long a);
		(>JDK1.0)    public static native double acos(double a); 
		(>JDK1.0)    public static native double asin(double a);
		(>JDK1.0)    public static native double atan(double a);
		(>JDK1.0)    public static native double atan2(double a, double b);
		(>JDK1.0)    public static native double ceil(double a);
		(>JDK1.0)    public static native double cos(double a);
		(>JDK1.0)    public static native double exp(double a);
		(>JDK1.0)    public static native double floor(double a);
		(>JDK1.0)    public static native double IEEEremainder(double f1, double f2);
		(>JDK1.0)    public static native double log(double a);
		(>JDK1.0)    public static double max(double a, double b);
		(>JDK1.0)    public static float max(float a, float b);
		(>JDK1.0)    public static int max(int a, int b);
		(>JDK1.0)    public static long max(long a, long b);
		(>JDK1.0)    public static double min(double a, double b);
		(>JDK1.0)    public static float min(float a, float b);
		(>JDK1.0)    public static int min(int a, int b);
		(>JDK1.0)    public static long min(long a, long b);
		(>JDK1.0)    public static native double pow(double a, double b);
		(>JDK1.0)    public static synchronized double random();
		(>JDK1.0)    public static native double rint(double a);
		(>JDK1.0)    public static long round(double a);
		(>JDK1.0)    public static int round(float a);
		(>JDK1.0)    public static native double sin(double a);
		(>JDK1.0)    public static native double sqrt(double a);
		(>JDK1.0)    public static native double tan(double a);
	}

Christophe Merlet
redfox@redfoxcenter.org
©Tous droits réservés
11 septembre 1998