scala

object Math

[source: scala/Math.scala]

object Math
extends AnyRef
The object Math contains methods for performing basic numeric operations such as the elementary exponential, logarithm, square root, and trigonometric functions.
Value Summary
val E : Double
The double value that is closer than any other to e, the base of the natural logarithms.
val EPS_DOUBLE : Double
The smallest difference between two values of scala.Double.
val EPS_FLOAT : Float
The smallest difference between two values of scala.Float.
val MAX_BYTE : Byte
The greatest possible value for scala.Byte.
val MAX_CHAR : Char
The greatest possible value for scala.Char.
val MAX_DOUBLE : Double
The greatest possible value for scala.Double.
val MAX_FLOAT : Float
The greatest possible value for scala.Float.
val MAX_INT : Int
The greatest possible value for scala.Int.
val MAX_LONG : Long
The greatest possible value for scala.Long.
val MAX_SHORT : Short
The greatest possible value for scala.Short.
val MIN_BYTE : Byte
The smallest possible value for scala.Byte.
val MIN_CHAR : Char
The smallest possible value for scala.Char.
val MIN_DOUBLE : Double
The smallest possible value for scala.Double.
val MIN_FLOAT : Float
The smallest possible value for scala.Float.
val MIN_INT : Int
The smallest possible value for scala.Int.
val MIN_LONG : Long
The smallest possible value for scala.Long.
val MIN_SHORT : Short
The smallest possible value for scala.Short.
val NEG_INF_DOUBLE : Double
Negative infinity of type scala.Double.
val NEG_INF_FLOAT : Float
Negative infinity of type scala.Float.
val NaN_DOUBLE : Double
A value of type scala.Double that represents no number.
val NaN_FLOAT : Float
A value of type scala.Float that represents no number.
val POS_INF_DOUBLE : Double
Positive infinity of type scala.Double.
val POS_INF_FLOAT : Float
Positive infinity of type scala.Float.
val Pi : Double
The double value that is closer than any other to pi, the ratio of the circumference of a circle to its diameter.
Method Summary
def IEEEremainder (x : Double, y : Double) : Double
def abs (x : Float) : Float
def abs (x : Long) : Long
def abs (x : Double) : Double
def abs (x : Int) : Int
def acos (x : Double) : Double
def asin (x : Double) : Double
def atan (x : Double) : Double
def atan2 (y : Double, x : Double) : Double
Converts rectangular coordinates (x, y) to polar (r, theta).
def ceil (x : Double) : Double
def cos (x : Double) : Double
def exp (x : Double) : Double
Returns Euler's number e raised to the power of a double value.
def floor (x : Double) : Double
def log (x : Double) : Double
def max (x : Double, y : Double) : Double
def max (x : Float, y : Float) : Float
def max (x : Int, y : Int) : Int
def max (x : Long, y : Long) : Long
def min (x : Int, y : Int) : Int
def min (x : Long, y : Long) : Long
def min (x : Double, y : Double) : Double
def min (x : Float, y : Float) : Float
def pow (x : Double, y : Double) : Double
Returns the value of the first argument raised to the power of the second argument.
def random : Double
Returns a double value with a positive sign, greater than or equal to 0.0 and less than 1.0.
def rint (x : Double) : Double
Returns the double value that is closest in value to the argument and is equal to a mathematical integer.
def round (x : Double) : Long
def round (x : Float) : Int
Returns the closest long to the argument.
def signum (x : Double) : Double
def signum (x : Long) : Long
def signum (x : Int) : Int
def signum (x : Float) : Float
def sin (x : Double) : Double
def sqrt (x : Double) : Double
def sqrt (x : Int) : Int
def tan (x : Double) : Double
def toDegrees (x : Double) : Double
Converts an angle measured in radians to an approximately equivalent angle measured in degrees.
def toRadians (x : Double) : Double
Converts an angle measured in degrees to an approximately equivalent angle measured in radians.
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Value Details
val MIN_BYTE : Byte
The smallest possible value for scala.Byte.

val MAX_BYTE : Byte
The greatest possible value for scala.Byte.

val MIN_SHORT : Short
The smallest possible value for scala.Short.

val MAX_SHORT : Short
The greatest possible value for scala.Short.

val MIN_CHAR : Char
The smallest possible value for scala.Char.

val MAX_CHAR : Char
The greatest possible value for scala.Char.

val MIN_INT : Int
The smallest possible value for scala.Int.

val MAX_INT : Int
The greatest possible value for scala.Int.

val MIN_LONG : Long
The smallest possible value for scala.Long.

val MAX_LONG : Long
The greatest possible value for scala.Long.

val MIN_FLOAT : Float
The smallest possible value for scala.Float.

val EPS_FLOAT : Float
The smallest difference between two values of scala.Float.

val MAX_FLOAT : Float
The greatest possible value for scala.Float.

val NaN_FLOAT : Float
A value of type scala.Float that represents no number.

val NEG_INF_FLOAT : Float
Negative infinity of type scala.Float.

val POS_INF_FLOAT : Float
Positive infinity of type scala.Float.

val MIN_DOUBLE : Double
The smallest possible value for scala.Double.

val EPS_DOUBLE : Double
The smallest difference between two values of scala.Double.

val MAX_DOUBLE : Double
The greatest possible value for scala.Double.

val NaN_DOUBLE : Double
A value of type scala.Double that represents no number.

val NEG_INF_DOUBLE : Double
Negative infinity of type scala.Double.

val POS_INF_DOUBLE : Double
Positive infinity of type scala.Double.

val E : Double
The double value that is closer than any other to e, the base of the natural logarithms.

val Pi : Double
The double value that is closer than any other to pi, the ratio of the circumference of a circle to its diameter.

Method Details
def random : Double
Returns a double value with a positive sign, greater than or equal to 0.0 and less than 1.0.

def sin(x : Double) : Double

def cos(x : Double) : Double

def tan(x : Double) : Double

def asin(x : Double) : Double

def acos(x : Double) : Double

def atan(x : Double) : Double

def toRadians(x : Double) : Double
Converts an angle measured in degrees to an approximately equivalent angle measured in radians.
Parameters
x - an angle, in degrees
Returns
the measurement of the angle x in radians.

def toDegrees(x : Double) : Double
Converts an angle measured in radians to an approximately equivalent angle measured in degrees.
Parameters
x - angle, in radians
Returns
the measurement of the angle x in degrees.

def exp(x : Double) : Double
Returns Euler's number e raised to the power of a double value.
Parameters
x - the exponent to raise e to.
Returns
the value ea, where e is the base of the natural logarithms.

def log(x : Double) : Double

def sqrt(x : Double) : Double

def sqrt(x : Int) : Int

def IEEEremainder(x : Double, y : Double) : Double

def ceil(x : Double) : Double

def floor(x : Double) : Double

def rint(x : Double) : Double
Returns the double value that is closest in value to the argument and is equal to a mathematical integer.
Parameters
x - a double value
Returns
the closest floating-point value to a that is equal to a mathematical integer.

def atan2(y : Double, x : Double) : Double
Converts rectangular coordinates (x, y) to polar (r, theta).
Parameters
x - the ordinate coordinate
y - the abscissa coordinate
Returns
the theta component of the point (r, theta) in polar coordinates that corresponds to the point (x, y) in Cartesian coordinates.

def pow(x : Double, y : Double) : Double
Returns the value of the first argument raised to the power of the second argument.
Parameters
x - the base.
y - the exponent.
Returns
the value xy.

def round(x : Float) : Int
Returns the closest long to the argument.
Parameters
x - a floating-point value to be rounded to a long.
Returns
the value of the argument rounded to the nearest long value.

def round(x : Double) : Long

def abs(x : Int) : Int

def abs(x : Long) : Long

def abs(x : Float) : Float

def abs(x : Double) : Double

def max(x : Int, y : Int) : Int

def max(x : Long, y : Long) : Long

def max(x : Float, y : Float) : Float

def max(x : Double, y : Double) : Double

def min(x : Int, y : Int) : Int

def min(x : Long, y : Long) : Long

def min(x : Float, y : Float) : Float

def min(x : Double, y : Double) : Double

def signum(x : Double) : Double

def signum(x : Float) : Float

def signum(x : Long) : Long

def signum(x : Int) : Int