scala.scalajs.js

Math

object Math extends Object

Math is a built-in object that has properties and methods for mathematical constants and functions. Not a function object.

MDN

Linear Supertypes
Object, Any, AnyRef, scala.Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Math
  2. Object
  3. Any
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: scala.Any): scala.Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. def +(that: String): String

    Definition Classes
    Any
  4. final def ==(arg0: scala.Any): scala.Boolean

    Definition Classes
    AnyRef → Any
  5. val E: Number

    Euler's constant and the base of natural logarithms, approximately 2.

    Euler's constant and the base of natural logarithms, approximately 2.718.

    MDN

  6. val LN10: Number

    Natural logarithm of 10, approximately 2.

    Natural logarithm of 10, approximately 2.303.

    MDN

  7. val LN2: Number

    Natural logarithm of 2, approximately 0.

    Natural logarithm of 2, approximately 0.693.

    MDN

  8. val LOG10E: Number

    Base 10 logarithm of E, approximately 0.

    Base 10 logarithm of E, approximately 0.434.

    MSN

  9. val LOG2E: Number

    Base 2 logarithm of E, approximately 1.

    Base 2 logarithm of E, approximately 1.443.

    MDN

  10. val PI: Number

    Ratio of the circumference of a circle to its diameter, approximately 3.

    Ratio of the circumference of a circle to its diameter, approximately 3.14159.

    MDN

  11. val SQRT1_2: Number

    Square root of 1/2; equivalently, 1 over the square root of 2, approximately 0.

    Square root of 1/2; equivalently, 1 over the square root of 2, approximately 0.707.

    MDN

  12. val SQRT2: Number

    Square root of 2, approximately 1.

    Square root of 2, approximately 1.414.

    MDN

  13. def abs(x: Number): Number

    Returns the absolute value of a number.

    Returns the absolute value of a number.

    Passing a non-numeric string or undefined/empty variable returns NaN. Passing null returns 0.

    MDN

  14. def acos(x: Number): Number

    The Math.

    The Math.acos() function returns the arccosine (in radians) of a number.

    The acos method returns a numeric value between 0 and pi radians for x between -1 and 1. If the value of number is outside this range, it returns NaN.

    MDN

  15. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  16. def asin(x: Number): Number

    The Math.

    The Math.asin() function returns the arcsine (in radians) of a number.

    The asin method returns a numeric value between -pi/2 and pi/2 radians for x between -1 and 1. If the value of number is outside this range, it returns NaN.

    MDN

  17. def atan(x: Number): Number

    The Math.

    The Math.atan() function returns the arctangent (in radians) of a number.

    The atan method returns a numeric value between -pi/2 and pi/2 radians.

    MDN

  18. def atan2(y: Number, x: Number): Number

    The Math.

    The Math.atan2() function returns the arctangent of the quotient of its arguments.

    The atan2 method returns a numeric value between -pi and pi representing the angle theta of an (x,y) point. This is the counterclockwise angle, measured in radians, between the positive X axis, and the point (x,y). Note that the arguments to this function pass the y-coordinate first and the x-coordinate second.

    atan2 is passed separate x and y arguments, and atan is passed the ratio of those two arguments.

    MDN

  19. def ceil(x: Number): Number

    The Math.

    The Math.ceil() function returns the smallest integer greater than or equal to a number.

    MDN

  20. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. def cos(x: Number): Number

    The Math.

    The Math.cos() function returns the cosine of a number.

    The cos method returns a numeric value between -1 and 1, which represents the cosine of the angle.

    MDN

  22. final def eq(arg0: AnyRef): scala.Boolean

    Definition Classes
    AnyRef
  23. def equals(arg0: scala.Any): scala.Boolean

    Definition Classes
    AnyRef → Any
  24. def exp(x: Number): Number

    The Math.

    The Math.exp() function returns E^x, where x is the argument, and E is Euler's constant, the base of the natural logarithms.

    MDN

  25. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  26. def floor(x: Number): Number

    The Math.

    The Math.floor() function returns the largest integer less than or equal to a number.

    MDN

  27. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  28. def hasOwnProperty(v: String): Boolean

    Every object descended from Object inherits the hasOwnProperty method.

    Every object descended from Object inherits the hasOwnProperty method. This method can be used to determine whether an object has the specified property as a direct property of that object; unlike the in operator, this method does not check down the object's prototype chain.

    MDN

    Definition Classes
    Object
  29. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  30. final def isInstanceOf[T0]: scala.Boolean

    Definition Classes
    Any
  31. def isPrototypeOf(v: Object): Boolean

    The isPrototypeOf mehtod allows you to check whether or not an object exists within another object's prototype chain.

    The isPrototypeOf mehtod allows you to check whether or not an object exists within another object's prototype chain.

    MDN

    Definition Classes
    Object
  32. def log(x: Number): Number

    The Math.

    The Math.log() function returns the natural logarithm (base E) of a number.

    If the value of number is negative, the return value is always NaN.

    MDN

  33. def max(values: Number*): Number

    The Math.

    The Math.max() function returns the largest of zero or more numbers.

    If no arguments are given, the result is - Infinity.

    If at least one of arguments cannot be converted to a number, the result is NaN.

    MDN

  34. def min(values: Number*): Number

    The Math.

    The Math.min() function returns the smallest of zero or more numbers.

    If no arguments are given, the result is Infinity.

    If at least one of arguments cannot be converted to a number, the result is NaN.

    MDN

  35. final def ne(arg0: AnyRef): scala.Boolean

    Definition Classes
    AnyRef
  36. final def notify(): Unit

    Definition Classes
    AnyRef
  37. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  38. def pow(x: Number, y: Number): Number

    The Math.

    The Math.pow() function returns the base to the exponent Power, that is, base^^exponent.

    MDN

  39. def propertyIsEnumerable(v: String): Boolean

    Every object has a propertyIsEnumerable method.

    Every object has a propertyIsEnumerable method. This method can determine whether the specified property in an object can be enumerated by a for...in loop, with the exception of properties inherited through the prototype chain. If the object does not have the specified property, this method returns false.

    MDN

    Definition Classes
    Object
  40. def random(): Number

    The Math.

    The Math.random() function returns a floating-point, pseudo-random number in the range [0, 1) that is, from 0 (inclusive) up to but not including 1 (exclusive), which you can then scale to your desired range.

    The random number generator is seeded from the current time, as in Java.

    MDN

  41. def round(x: Number): Number

    The Math.

    The Math.round() function returns the value of a number rounded to the nearest integer.

    If the fractional portion of number is .5 or greater, the argument is rounded to the next higher integer. If the fractional portion of number is less than .5, the argument is rounded to the next lower integer.

    MDN

  42. def sin(x: Number): Number

    The Math.

    The Math.sin() function returns the sine of a number.

    The sin method returns a numeric value between -1 and 1, which represents the sine of the angle given in radians.

    MDN

  43. def sqrt(x: Number): Number

    The Math.

    The Math.sqrt() function returns the square root (x\sqrt{x}) of a number.

    If the value of number is negative, sqrt returns NaN.

    MDN

  44. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  45. def tan(x: Number): Number

    The Math.

    The Math.tan() function returns the tangent of a number.

    The tan method returns a numeric value that represents the tangent of the angle.

    MDN

  46. def toLocaleString(): String

    Definition Classes
    Object
  47. def toString(): java.lang.String

    Definition Classes
    AnyRef → Any
  48. def unary_!(): Boolean

    Definition Classes
    Any
  49. def valueOf(): Any

    Definition Classes
    Object
  50. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  51. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  52. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from scala.Any

Ungrouped