Data Types - Numbers
Integers
- Decimal - A normal integer without a leading zero (e.g., 34)
- Octal - A integer with a leading 0 (e.g., 064)
- Hexadecimal - An integer with a leading 0x or 0X (e.g.,0xC5)
Note: Maximum integer size depends on the platform
Floating Point
- Numbers that have a decimal point (e.g., 1.98 or 3.0)
- Numbers that have an exponent (e.g., 2E5 or 3.4e3)
Note: JavaScripts's handling of floating point numbers can introduce
inaccuracies into some calculations.
Negative Numbers
Operators
Properties (built-in constants)
Property |
Description |
Approx. Value |
E |
Euler's Constant |
2.718 |
LN10 |
natural logarithm of 10 |
2.302 |
LN2 |
natural logarithm of 2 |
0.693 |
PI |
PI |
3.1415 |
SQRT1_2 |
square root of one-half |
0.707 |
SQRT2 |
square root of two |
1.414 |
Methods (built-in functions)
- abs
- acos
- asin
- atan
- ceil
- cos
- exp
- floor
- log
- max
- min
- pow
- random
- round
- sin
- sqrt
- tan
Back