Scala Library
|
|
scala/Math.scala
]
object
Math
extends
AnyRefMath
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 : Double) : Double |
def
|
abs (x : Int) : Int |
def
|
abs (x : Long) : Long |
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 : Int, y : Int) : Int |
def
|
max (x : Long, y : Long) : Long |
def
|
max (x : Double, y : Double) : Double |
def
|
max (x : Float, y : Float) : Float |
def
|
min (x : Long, y : Long) : Long |
def
|
min (x : Double, y : Double) : Double |
def
|
min (x : Int, y : Int) : Int |
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 : Float) : Int
Returns the closest
long to the argument. |
def
|
round (x : Double) : Long |
def
|
signum (x : Double) : Double |
def
|
signum (x : Int) : Int |
def
|
signum (x : Long) : Long |
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
val
MAX_BYTE : Byte
val
MIN_SHORT : Short
val
MAX_SHORT : Short
val
MIN_CHAR : Char
val
MAX_CHAR : Char
val
MIN_INT : Int
val
MAX_INT : Int
val
MIN_LONG : Long
val
MAX_LONG : Long
val
MIN_FLOAT : Float
val
EPS_FLOAT : Float
val
MAX_FLOAT : Float
val
NaN_FLOAT : Float
val
NEG_INF_FLOAT : Float
val
POS_INF_FLOAT : Float
val
MIN_DOUBLE : Double
val
EPS_DOUBLE : Double
val
MAX_DOUBLE : Double
val
NaN_DOUBLE : Double
val
NEG_INF_DOUBLE : Double
val
POS_INF_DOUBLE : Double
val
E : Double
double
value that is closer than any other to
e
, the base of the natural logarithms.
val
Pi : Double
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
double
value with a positive sign, greater than
or equal to 0.0
and less than 1.0
.x -
an angle, in degreesx
in radians.x -
angle, in radiansx
in degrees.e
raised to the power of a
double
value.x -
the exponent to raise e
to.ea
, where e
is the base of the natural logarithms.double
value that is closest in value to the
argument and is equal to a mathematical integer.x -
a double
value(x, y)
to polar
(r, theta)
.x -
the ordinate coordinatey -
the abscissa coordinate(r, theta)
in polar coordinates that corresponds to the point
(x, y)
in Cartesian coordinates.x -
the base.y -
the exponent.xy
.long
to the argument.x -
a floating-point value to be rounded to a long
.long
value.
Scala Library
|
|