Class JSMath
java.lang.Object
org.fife.rsta.ac.js.ecma.api.ecma3.JSMath
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic JSNumberproperty E the constant e, the base of the natural logarithm.static JSNumberproperty LN10 the natural logarithm of 10.static JSNumberproperty LN2 the natural logarithm of 2.static JSNumberproperty LOG10E the base-10 logarithm of e.static JSNumberproperty LOG2E the base-2 logarithm of e.static JSNumberproperty PI The constant PI.static JSNumberproperty SQRT1_2 the number 1 divided by the square root of 2.static JSNumberproperty SQRT2 the square root of 2. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic JSNumberfunction abs(x) computes an absolute value.static JSNumberfunction acos(x) compute an arccosinestatic JSNumberfunction asin(x) compute an arcsinestatic JSNumberfunction atan(x) compute an arctangentstatic JSNumberfunction atan2(x,y) compute the angle from the X axis to a point.static JSNumberfunction ceil(x) round a number up.static JSNumberfunction cos(x) compute a cosine.static JSNumberfunction exp(x) compute Ex.static JSNumberfunction floor(x) round a number down.static JSNumberfunction log(x) compute a natural logarithm.static JSNumberfunction max(args) Return the largest argument.static JSNumberfunction min(args) return the smallest argument.static JSNumberfunction pow(x,y) compute Xystatic JSNumberrandom()function random() return a pseudorandom numberstatic JSNumberfunction round(x) round to the nearest integer.static JSNumberfunction sin(x) compute a sine.static JSNumberfunction sqrt(x) compute a square root.static JSNumberfunction tan(x) compute a tangent.
-
Field Details
-
E
property E the constant e, the base of the natural logarithm.- Since:
- Standard ECMA-262 3rd. Edition, Level 2 Document Object Model Core Definition.
- See Also:
-
LN10
property LN10 the natural logarithm of 10.- Since:
- Standard ECMA-262 3rd. Edition, Level 2 Document Object Model Core Definition.
- See Also:
-
LN2
property LN2 the natural logarithm of 2.- Since:
- Standard ECMA-262 3rd. Edition, Level 2 Document Object Model Core Definition.
- See Also:
-
LOG2E
property LOG2E the base-2 logarithm of e.- Since:
- Standard ECMA-262 3rd. Edition, Level 2 Document Object Model Core Definition.
- See Also:
-
LOG10E
property LOG10E the base-10 logarithm of e.- Since:
- Standard ECMA-262 3rd. Edition, Level 2 Document Object Model Core Definition.
- See Also:
-
PI
property PI The constant PI.- Since:
- Standard ECMA-262 3rd. Edition, Level 2 Document Object Model Core Definition.
- See Also:
-
SQRT1_2
property SQRT1_2 the number 1 divided by the square root of 2.- Since:
- Standard ECMA-262 3rd. Edition, Level 2 Document Object Model Core Definition.
- See Also:
-
SQRT2
property SQRT2 the square root of 2.- Since:
- Standard ECMA-262 3rd. Edition, Level 2 Document Object Model Core Definition.
- See Also:
-
-
Constructor Details
-
JSMath
public JSMath()
-
-
Method Details
-
abs
-
acos
-
asin
-
atan
-
atan2
-
ceil
function ceil(x) round a number up.Example
a = Math.ceil(1.99); //returns 2.0 b = Math.ceil(1.01); //returns 2.0 c = Math.ceil(1.0) //returns 1.0 d = Math.ceil(-1.99); //returns -1.0
- Parameters:
x- any number or numeric value.- Since:
- Standard ECMA-262 3rd. Edition, Level 2 Document Object Model Core Definition.
- See Also:
-
cos
-
exp
-
floor
function floor(x) round a number down.Example
a = Math.floor(1.99); //returns 1.0 b = Math.floor(1.01); //returns 1.0 c = Math.floor(1.0) //returns 1.0 d = Math.floor(-1.99); //returns -2.0
- Parameters:
x- any number or numeric value.- Since:
- Standard ECMA-262 3rd. Edition, Level 2 Document Object Model Core Definition.
- See Also:
-
log
-
max
-
min
-
pow
-
random
function random() return a pseudorandom number- Since:
- Standard ECMA-262 3rd. Edition, Level 2 Document Object Model Core Definition.
- See Also:
-
round
-
sin
-
sqrt
-
tan
-