scala

Math

object Math extends MathCommon

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

source: Math.scala
    deprecated:
  1. use scala . math package instead

Inherited
  1. Hide All
  2. Show all
  1. MathCommon
  2. AnyRef
  3. Any
Visibility
  1. Public
  2. All

Value Members

  1. def !=(arg0: AnyRef): Boolean

    attributes: final
    definition classes: AnyRef
  2. def !=(arg0: Any): Boolean

    o != arg0 is the same as !(o == (arg0)).

    o != arg0 is the same as !(o == (arg0)).

    arg0

    the object to compare against this object for dis-equality .

    returns

    false if the receiver object is equivalent to the argument; true otherwise.

    attributes: final
    definition classes: Any
  3. def ##(): Int

    attributes: final
    definition classes: AnyRef → Any
  4. def $asInstanceOf[T0](): T0

    attributes: final
    definition classes: AnyRef
  5. def $isInstanceOf[T0](): Boolean

    attributes: final
    definition classes: AnyRef
  6. def ==(arg0: AnyRef): Boolean

    o == arg0 is the same as if (o eq null) arg0 eq null else o.equals(arg0).

    o == arg0 is the same as if (o eq null) arg0 eq null else o.equals(arg0).

    arg0

    the object to compare against this object for equality .

    returns

    true if the receiver object is equivalent to the argument; false otherwise.

    attributes: final
    definition classes: AnyRef
  7. def ==(arg0: Any): Boolean

    o == arg0 is the same as o.equals(arg0).

    o == arg0 is the same as o.equals(arg0).

    arg0

    the object to compare against this object for equality .

    returns

    true if the receiver object is equivalent to the argument; false otherwise.

    attributes: final
    definition classes: Any
  8. val E: Double

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

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

    definition classes: MathCommon
  9. val EPS_DOUBLE: Double

    The smallest difference between two values of

      deprecated:
    1. Use scala . Double.Epsilon instead

  • val EPS_FLOAT: Float

    The smallest difference between two values of

      deprecated:
    1. Use scala . Float.Epsilon instead

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

    definition classes: MathCommon
  • val MAX_BYTE: Byte

      deprecated:
    1. Use scala . Byte.MaxValue instead

  • val MAX_CHAR: Char

      deprecated:
    1. Use scala . Char.MaxValue instead

  • val MAX_DOUBLE: Double

    The greatest possible value for

    The greatest possible value for scala.Double.

      deprecated:
    1. Use scala . Double.MaxValue instead

  • val MAX_FLOAT: Float

    The greatest possible value for

    The greatest possible value for scala.Float.

      deprecated:
    1. Use scala . Float.MaxValue instead

  • val MAX_INT: Int

      deprecated:
    1. Use scala . Int.MaxValue instead

  • val MAX_LONG: Long

      deprecated:
    1. Use scala . Long.MaxValue instead

  • val MAX_SHORT: Short

      deprecated:
    1. Use scala . Short.MaxValue instead

  • val MIN_BYTE: Byte

      deprecated:
    1. Use scala . Byte.MinValue instead

  • val MIN_CHAR: Char

      deprecated:
    1. Use scala . Char.MinValue instead

  • val MIN_DOUBLE: Double

    The smallest possible value for

    The smallest possible value for scala.Double.

      deprecated:
    1. Use scala . Double.MinValue instead

  • val MIN_FLOAT: Float

    The smallest possible value for

    The smallest possible value for scala.Float.

      deprecated:
    1. Use scala . Float.MinValue instead

  • val MIN_INT: Int

      deprecated:
    1. Use scala . Int.MinValue instead

  • val MIN_LONG: Long

      deprecated:
    1. Use scala . Long.MinValue instead

  • val MIN_SHORT: Short

      deprecated:
    1. Use scala . Short.MinValue instead

  • val NEG_INF_DOUBLE: Double

    Negative infinity of type

    Negative infinity of type scala.Double.

      deprecated:
    1. Use scala . Double.NegativeInfinity instead

  • val NEG_INF_FLOAT: Float

    Negative infinity of type

    Negative infinity of type scala.Float.

      deprecated:
    1. Use scala . Float.NegativeInfinity instead

  • val NaN_DOUBLE: Double

    A value of type

    A value of type scala.Double that represents no number.

      deprecated:
    1. Use scala . Double.NaN instead

  • val NaN_FLOAT: Float

    A value of type

    A value of type scala.Float that represents no number.

      deprecated:
    1. Use scala . Float.NaN instead

  • val POS_INF_DOUBLE: Double

    Positive infinity of type

    Positive infinity of type scala.Double.

      deprecated:
    1. Use scala . Double.PositiveInfinity instead

  • val POS_INF_FLOAT: Float

    Positive infinity of type

    Positive infinity of type scala.Float.

      deprecated:
    1. Use scala . Float.PositiveInfinity instead

  • 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 .

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

    definition classes: MathCommon
  • def abs(x: Double): Double

    definition classes: MathCommon
  • def abs(x: Float): Float

    definition classes: MathCommon
  • def abs(x: Long): Long

    definition classes: MathCommon
  • def abs(x: Int): Int

    definition classes: MathCommon
  • def acos(x: Double): Double

    definition classes: MathCommon
  • def asInstanceOf[T0]: T0

    This method is used to cast the receiver object to be of type T0.

    This method is used to cast the receiver object to be of type T0.

    Note that the success of a cast at runtime is modulo Scala's erasure semantics. Therefore the expression1.asInstanceOf[String] will throw a ClassCastException at runtime, while the expressionList(1).asInstanceOf[List[String]] will not. In the latter example, because the type argument is erased as part of compilation it is not possible to check whether the contents of the list are of the requested typed.

    returns

    the receiver object .

    attributes: final
    definition classes: Any
  • def asin(x: Double): Double

    definition classes: MathCommon
  • def atan(x: Double): Double

    definition classes: MathCommon
  • def atan2(y: Double, x: Double): Double

    Converts rectangular coordinates (x, y) to polar (r, theta) .

    Converts rectangular coordinates (x, y) to polar (r, theta) .

    y

    the abscissa coordinate

    x

    the ordinate coordinate

    returns

    the theta component of the point (r, theta) in polar coordinates that corresponds to the point (x, y) in Cartesian coordinates .

    definition classes: MathCommon
  • def ceil(x: Double): Double

    definition classes: MathCommon
  • def clone(): AnyRef

    This method creates and returns a copy of the receiver object .

    This method creates and returns a copy of the receiver object .

    The default implementation of the clone method is platform dependent.

    returns

    a copy of the receiver object .

    attributes: protected
    definition classes: AnyRef
  • def cos(x: Double): Double

    definition classes: MathCommon
  • def eq(arg0: AnyRef): Boolean

    This method is used to test whether the argument (arg0) is a reference to the receiver object (this).

    This method is used to test whether the argument (arg0) is a reference to the receiver object (this).

    The eq method implements an [http://en.wikipedia.org/wiki/Equivalence_relation equivalence relation] on non-null instances of AnyRef: * It is reflexive: for any non-null instance x of type AnyRef, x.eq(x) returns true. * It is symmetric: for any non-null instances x and y of type AnyRef, x.eq(y) returns true if and only if y.eq(x) returns true. * It is transitive: for any non-null instances x, y, and z of type AnyRef if x.eq(y) returns true and y.eq(z) returns true, then x.eq(z) returns true.

    Additionally, the eq method has three other properties. * It is consistent: for any non-null instances x and y of type AnyRef, multiple invocations of x.eq(y) consistently returns true or consistently returns false. * For any non-null instance x of type AnyRef, x.eq(null) and null.eq(x) returns false. * null.eq(null) returns true.

    When overriding the equals or hashCode methods, it is important to ensure that their behavior is consistent with reference equality. Therefore, if two objects are references to each other (o1 eq o2), they should be equal to each other (o1 == o2) and they should hash to the same value (o1.hashCode == o2.hashCode).

    arg0

    the object to compare against this object for reference equality .

    returns

    true if the argument is a reference to the receiver object; false otherwise.

    attributes: final
    definition classes: AnyRef
  • def equals(arg0: Any): Boolean

    This method is used to compare the receiver object (this) with the argument object (arg0) for equivalence.

    This method is used to compare the receiver object (this) with the argument object (arg0) for equivalence.

    The default implementations of this method is an [http://en.wikipedia.org/wiki/Equivalence_relation equivalence relation]: * It is reflexive: for any instance x of type Any, x.equals(x) should return true. * It is symmetric: for any instances x and y of type Any, x.equals(y) should return true if and only if y.equals(x) returns true. * It is transitive: for any instances x, y, and z of type AnyRef if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.

    If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is often necessary to override hashCode to ensure that objects that are "equal" (o1.equals(o2) returns true) hash to the same scala.Int (o1.hashCode.equals(o2.hashCode)).

    arg0

    the object to compare against this object for equality .

    returns

    true if the receiver object is equivalent to the argument; false otherwise.

    definition classes: AnyRef → Any
  • def exp(x: Double): Double

    Returns Euler's number e raised to the power of a double value .

    Returns Euler's number e raised to the power of a double value .

    x

    the exponent to raise e to .

    returns

    the value ea, where e is the base of the natural logarithms .

    definition classes: MathCommon
  • def finalize(): Unit

    This method is called by the garbage collector on the receiver object when garbage collection determines that there are no more references to the object .

    This method is called by the garbage collector on the receiver object when garbage collection determines that there are no more references to the object .

    The details of when and if the finalize method are invoked, as well as the interaction between finalizeand non-local returns and exceptions, are all platform dependent.

    attributes: protected
    definition classes: AnyRef
  • def floor(x: Double): Double

    definition classes: MathCommon
  • def getClass(): java.lang.Class[_ <: java.lang.Object]

    Returns a representation that corresponds to the dynamic class of the receiver object .

    Returns a representation that corresponds to the dynamic class of the receiver object .

    The nature of the representation is platform dependent.

    returns

    a representation that corresponds to the dynamic class of the receiver object .

    attributes: final
    definition classes: AnyRef
  • def hashCode(): Int

    Returns a hash code value for the object .

    Returns a hash code value for the object .

    The default hashing algorithm is platform dependent.

    Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)) yet not be equal (o1.equals(o2) returns false). A degenerate implementation could always return 0. However, it is required that if two objects are equal (o1.equals(o2) returns true) that they have identical hash codes (o1.hashCode.equals(o2.hashCode)). Therefore, when overriding this method, be sure to verify that the behavior is consistent with the equals method.

    returns

    the hash code value for the object .

    definition classes: AnyRef → Any
  • def isInstanceOf[T0]: Boolean

    This method is used to test whether the dynamic type of the receiver object is T0.

    This method is used to test whether the dynamic type of the receiver object is T0.

    Note that the test result of the test is modulo Scala's erasure semantics. Therefore the expression1.isInstanceOf[String] will return false, while the expression List(1).isInstanceOf[List[String]] will return true. In the latter example, because the type argument is erased as part of compilation it is not possible to check whether the contents of the list are of the requested typed.

    returns

    true if the receiver object is an instance of erasure of type T0; false otherwise.

    attributes: final
    definition classes: Any
  • def log(x: Double): Double

    definition classes: MathCommon
  • def max(x: Double, y: Double): Double

    definition classes: MathCommon
  • def max(x: Float, y: Float): Float

    definition classes: MathCommon
  • def max(x: Long, y: Long): Long

    definition classes: MathCommon
  • def max(x: Int, y: Int): Int

    definition classes: MathCommon
  • def min(x: Double, y: Double): Double

    definition classes: MathCommon
  • def min(x: Float, y: Float): Float

    definition classes: MathCommon
  • def min(x: Long, y: Long): Long

    definition classes: MathCommon
  • def min(x: Int, y: Int): Int

    definition classes: MathCommon
  • def ne(arg0: AnyRef): Boolean

    o.ne(arg0) is the same as !(o.eq(arg0)).

    o.ne(arg0) is the same as !(o.eq(arg0)).

    arg0

    the object to compare against this object for reference dis-equality .

    returns

    false if the argument is not a reference to the receiver object; true otherwise.

    attributes: final
    definition classes: AnyRef
  • def notify(): Unit

    Wakes up a single thread that is waiting on the receiver object's monitor .

    Wakes up a single thread that is waiting on the receiver object's monitor .

    attributes: final
    definition classes: AnyRef
  • def notifyAll(): Unit

    Wakes up all threads that are waiting on the receiver object's monitor .

    Wakes up all threads that are waiting on the receiver object's monitor .

    attributes: final
    definition classes: AnyRef
  • def pow(x: Double, y: Double): Double

    Returns the value of the first argument raised to the power of the second argument .

    Returns the value of the first argument raised to the power of the second argument .

    x

    the base .

    y

    the exponent .

    returns

    the value xy .

    definition classes: MathCommon
  • def random: Double

    Returns a double value with a positive sign, greater than or equal to 0 .

    Returns a double value with a positive sign, greater than or equal to 0 . 0 and less than 1.0.

    definition classes: MathCommon
  • def rint(x: Double): Double

    Returns the double value that is closest in value to the argument and is equal to a mathematical integer .

    Returns the double value that is closest in value to the argument and is equal to a mathematical integer .

    x

    a double value

    returns

    the closest floating-point value to a that is equal to a mathematical integer .

    definition classes: MathCommon
  • def round(x: Double): Long

    definition classes: MathCommon
  • def round(x: Float): Int

    Returns the closest long to the argument .

    Returns the closest long to the argument .

    x

    a floating-point value to be rounded to a long .

    returns

    the value of the argument rounded to the nearest long value .

    definition classes: MathCommon
  • def signum(x: Int): Int

    definition classes: MathCommon
  • def signum(x: Long): Long

    definition classes: MathCommon
  • def signum(x: Float): Float

    definition classes: MathCommon
  • def signum(x: Double): Double

    definition classes: MathCommon
  • def sin(x: Double): Double

    definition classes: MathCommon
  • def sqrt(x: Double): Double

    definition classes: MathCommon
  • def synchronized[T0](arg0: T0): T0

    attributes: final
    definition classes: AnyRef
  • def tan(x: Double): Double

    definition classes: MathCommon
  • def toDegrees(x: Double): Double

    Converts an angle measured in radians to an approximately equivalent angle measured in degrees .

    Converts an angle measured in radians to an approximately equivalent angle measured in degrees .

    x

    angle, in radians

    returns

    the measurement of the angle x in degrees .

    definition classes: MathCommon
  • def toRadians(x: Double): Double

    Converts an angle measured in degrees to an approximately equivalent angle measured in radians .

    Converts an angle measured in degrees to an approximately equivalent angle measured in radians .

    x

    an angle, in degrees

    returns

    the measurement of the angle x in radians .

    definition classes: MathCommon
  • def toString(): String

    Returns a string representation of the object .

    Returns a string representation of the object .

    The default representation is platform dependent.

    returns

    a string representation of the object .

    definition classes: AnyRef → Any
  • def wait(): Unit

    attributes: final
    definition classes: AnyRef
  • def wait(arg0: Long, arg1: Int): Unit

    attributes: final
    definition classes: AnyRef
  • def wait(arg0: Long): Unit

    attributes: final
    definition classes: AnyRef