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.

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

linear super types: MathCommon, AnyRef, Any
annotations: @deprecated( message = ... )
source: Math.scala
    deprecated:
  1. use the scala.math package object instead. (Example package object usage: scala.math.Pi )

Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. Math
  2. MathCommon
  3. AnyRef
  4. Any
Visibility
  1. Public
  2. All
Impl.
  1. Concrete
  2. Abstract

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

    The smallest difference between two values of scala.Double.

    annotations: @deprecated( message = ... )
      deprecated:
    1. Use scala.Double.MinPositiveValue instead

  10. val EPS_FLOAT : Float

    The smallest difference between two values of scala.

    The smallest difference between two values of scala.Float.

    annotations: @deprecated( message = ... )
      deprecated:
    1. Use scala.Float.MinPositiveValue instead

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

    definition classes: MathCommon
  12. val MAX_BYTE : Byte

    annotations: @deprecated( message = "Use scala.Byte.MaxValue instead" )
      deprecated:
    1. Use scala.Byte.MaxValue instead

  13. val MAX_CHAR : Char

    annotations: @deprecated( message = "Use scala.Char.MaxValue instead" )
      deprecated:
    1. Use scala.Char.MaxValue instead

  14. val MAX_DOUBLE : Double

    The greatest possible value for scala.

    The greatest possible value for scala.Double.

    annotations: @deprecated( message = "Use scala.Double.MaxValue instead" )
      deprecated:
    1. Use scala.Double.MaxValue instead

  15. val MAX_FLOAT : Float

    The greatest possible value for scala.

    The greatest possible value for scala.Float.

    annotations: @deprecated( message = "Use scala.Float.MaxValue instead" )
      deprecated:
    1. Use scala.Float.MaxValue instead

  16. val MAX_INT : Int

    annotations: @deprecated( message = "Use scala.Int.MaxValue instead" )
      deprecated:
    1. Use scala.Int.MaxValue instead

  17. val MAX_LONG : Long

    annotations: @deprecated( message = "Use scala.Long.MaxValue instead" )
      deprecated:
    1. Use scala.Long.MaxValue instead

  18. val MAX_SHORT : Short

    annotations: @deprecated( message = "Use scala.Short.MaxValue instead" )
      deprecated:
    1. Use scala.Short.MaxValue instead

  19. val MIN_BYTE : Byte

    annotations: @deprecated( message = "Use scala.Byte.MinValue instead" )
      deprecated:
    1. Use scala.Byte.MinValue instead

  20. val MIN_CHAR : Char

    annotations: @deprecated( message = "Use scala.Char.MinValue instead" )
      deprecated:
    1. Use scala.Char.MinValue instead

  21. val MIN_DOUBLE : Double

    The smallest possible value for scala.

    The smallest possible value for scala.Double.

    annotations: @deprecated( message = "Use scala.Double.MinValue instead" )
      deprecated:
    1. Use scala.Double.MinValue instead

  22. val MIN_FLOAT : Float

    The smallest possible value for scala.

    The smallest possible value for scala.Float.

    annotations: @deprecated( message = "Use scala.Float.MinValue instead" )
      deprecated:
    1. Use scala.Float.MinValue instead

  23. val MIN_INT : Int

    annotations: @deprecated( message = "Use scala.Int.MinValue instead" )
      deprecated:
    1. Use scala.Int.MinValue instead

  24. val MIN_LONG : Long

    annotations: @deprecated( message = "Use scala.Long.MinValue instead" )
      deprecated:
    1. Use scala.Long.MinValue instead

  25. val MIN_SHORT : Short

    annotations: @deprecated( message = "Use scala.Short.MinValue instead" )
      deprecated:
    1. Use scala.Short.MinValue instead

  26. val NEG_INF_DOUBLE : Double

    Negative infinity of type scala.

    Negative infinity of type scala.Double.

    annotations: @deprecated( message = ... )
      deprecated:
    1. Use scala.Double.NegativeInfinity instead

  27. val NEG_INF_FLOAT : Float

    Negative infinity of type scala.

    Negative infinity of type scala.Float.

    annotations: @deprecated( message = ... )
      deprecated:
    1. Use scala.Float.NegativeInfinity instead

  28. val NaN_DOUBLE : Double

    A value of type scala.

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

    annotations: @deprecated( message = "Use scala.Double.NaN instead" )
      deprecated:
    1. Use scala.Double.NaN instead

  29. val NaN_FLOAT : Float

    A value of type scala.

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

    annotations: @deprecated( message = "Use scala.Float.NaN instead" )
      deprecated:
    1. Use scala.Float.NaN instead

  30. val POS_INF_DOUBLE : Double

    Positive infinity of type scala.

    Positive infinity of type scala.Double.

    annotations: @deprecated( message = ... )
      deprecated:
    1. Use scala.Double.PositiveInfinity instead

  31. val POS_INF_FLOAT : Float

    Positive infinity of type scala.

    Positive infinity of type scala.Float.

    annotations: @deprecated( message = ... )
      deprecated:
    1. Use scala.Float.PositiveInfinity instead

  32. 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
  33. def abs ( x : Double ) : Double

    definition classes: MathCommon
  34. def abs ( x : Float ) : Float

    definition classes: MathCommon
  35. def abs ( x : Long ) : Long

    definition classes: MathCommon
  36. def abs ( x : Int ) : Int

    definition classes: MathCommon
  37. def acos ( x : Double ) : Double

    definition classes: MathCommon
  38. 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 expression 1.asInstanceOf[String] will throw a ClassCastException at runtime, while the expression List(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
  39. def asin ( x : Double ) : Double

    definition classes: MathCommon
  40. def atan ( x : Double ) : Double

    definition classes: MathCommon
  41. 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
  42. def ceil ( x : Double ) : Double

    definition classes: MathCommon
  43. 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[lang]
    definition classes: AnyRef
    annotations: @throws()
  44. def cos ( x : Double ) : Double

    definition classes: MathCommon
  45. 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
  46. 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 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
  47. 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
  48. 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 finalize and non-local returns and exceptions, are all platform dependent.

    attributes: protected[lang]
    definition classes: AnyRef
    annotations: @throws()
  49. def floor ( x : Double ) : Double

    definition classes: MathCommon
  50. 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
  51. 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
  52. 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 expression 1.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
  53. def log ( x : Double ) : Double

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

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

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

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

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

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

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

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

    definition classes: MathCommon
  62. 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
  63. 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
  64. 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
  65. 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
  66. def random : Double

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

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

    definition classes: MathCommon
  67. 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
  68. def round ( x : Double ) : Long

    definition classes: MathCommon
  69. 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
  70. def signum ( x : Int ) : Int

    definition classes: MathCommon
  71. def signum ( x : Long ) : Long

    definition classes: MathCommon
  72. def signum ( x : Float ) : Float

    definition classes: MathCommon
  73. def signum ( x : Double ) : Double

    definition classes: MathCommon
  74. def sin ( x : Double ) : Double

    definition classes: MathCommon
  75. def sqrt ( x : Double ) : Double

    definition classes: MathCommon
  76. def synchronized [T0] ( arg0 : ⇒ T0 ) : T0

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

    definition classes: MathCommon
  78. 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
  79. 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
  80. 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
  81. def wait () : Unit

    attributes: final
    definition classes: AnyRef
    annotations: @throws()
  82. def wait ( arg0 : Long , arg1 : Int ) : Unit

    attributes: final
    definition classes: AnyRef
    annotations: @throws()
  83. def wait ( arg0 : Long ) : Unit

    attributes: final
    definition classes: AnyRef
    annotations: @throws()

Inherited from MathCommon

Inherited from AnyRef

Inherited from Any