|
| 1 | +# Math |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | +## Module Function |
| 7 | + |
| 8 | +### abs(FLOAT) |
| 9 | +> Returns `FLOAT` |
| 10 | +
|
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | +### acos(FLOAT) |
| 16 | +> Returns `FLOAT` |
| 17 | +
|
| 18 | +Returns the arccosine, in radians, of the argument |
| 19 | + |
| 20 | + |
| 21 | +```js |
| 22 | +🚀 > Math.acos(1.0) |
| 23 | +=> 0.0 |
| 24 | +``` |
| 25 | + |
| 26 | + |
| 27 | +### asin(FLOAT) |
| 28 | +> Returns `FLOAT` |
| 29 | +
|
| 30 | +Returns the arcsine, in radians, of the argument |
| 31 | + |
| 32 | + |
| 33 | +```js |
| 34 | +🚀 > Math.asin(0.0) |
| 35 | +=> 0.0 |
| 36 | +``` |
| 37 | + |
| 38 | + |
| 39 | +### atan(FLOAT) |
| 40 | +> Returns `FLOAT` |
| 41 | +
|
| 42 | +Returns the arctangent, in radians, of the argument |
| 43 | + |
| 44 | + |
| 45 | +```js |
| 46 | +🚀 > Math.atan(0.0) |
| 47 | +=> 0.0 |
| 48 | +``` |
| 49 | + |
| 50 | + |
| 51 | +### ceil(FLOAT) |
| 52 | +> Returns `FLOAT` |
| 53 | +
|
| 54 | +Returns the least integer value greater or equal to the argument |
| 55 | + |
| 56 | + |
| 57 | +```js |
| 58 | +🚀 > Math.ceil(1.49) |
| 59 | +=> 2.0 |
| 60 | +``` |
| 61 | + |
| 62 | + |
| 63 | +### copysign(FLOAT, FLOAT) |
| 64 | +> Returns `FLOAT` |
| 65 | +
|
| 66 | +Returns a value with the magnitude of first argument and sign of second argument |
| 67 | + |
| 68 | + |
| 69 | +```js |
| 70 | +🚀 > Math.copysign(3.2, -1.0) |
| 71 | +=> -3.2 |
| 72 | +``` |
| 73 | + |
| 74 | + |
| 75 | +### cos(FLOAT) |
| 76 | +> Returns `FLOAT` |
| 77 | +
|
| 78 | +Returns the cosine of the radion argument |
| 79 | + |
| 80 | + |
| 81 | +```js |
| 82 | +🚀 > Math.cos(Pi/2) |
| 83 | +=> 0.0 |
| 84 | +``` |
| 85 | + |
| 86 | + |
| 87 | +### exp(FLOAT) |
| 88 | +> Returns `FLOAT` |
| 89 | +
|
| 90 | +Returns e**argument, the base-e exponential of argument |
| 91 | + |
| 92 | + |
| 93 | +```js |
| 94 | +🚀 > Math.exp(1.0) |
| 95 | +=> 2.72 |
| 96 | +``` |
| 97 | + |
| 98 | + |
| 99 | +### floor(FLOAT) |
| 100 | +> Returns `FLOAT` |
| 101 | +
|
| 102 | +Returns the greatest integer value less than or equal to argument |
| 103 | + |
| 104 | + |
| 105 | +```js |
| 106 | +🚀 > Math.floor(1.51) |
| 107 | +=> 1.0 |
| 108 | +``` |
| 109 | + |
| 110 | + |
| 111 | +### log(FLOAT) |
| 112 | +> Returns `FLOAT` |
| 113 | +
|
| 114 | +Returns the natural logarithm of argument |
| 115 | + |
| 116 | + |
| 117 | +```js |
| 118 | +🚀 > Math.log(2.7183) |
| 119 | +=> 1.0 |
| 120 | +``` |
| 121 | + |
| 122 | + |
| 123 | +### log10(FLOAT) |
| 124 | +> Returns `FLOAT` |
| 125 | +
|
| 126 | +Returns the decimal logarithm of argument |
| 127 | + |
| 128 | + |
| 129 | +```js |
| 130 | +🚀 > Math.log(100.0) |
| 131 | +=> 2.0 |
| 132 | +``` |
| 133 | + |
| 134 | + |
| 135 | +### log2(FLOAT) |
| 136 | +> Returns `FLOAT` |
| 137 | +
|
| 138 | +Returns the binary logarithm of argument |
| 139 | + |
| 140 | + |
| 141 | +```js |
| 142 | +🚀 > Math.log2(256.0) |
| 143 | +=> 8.0 |
| 144 | +``` |
| 145 | + |
| 146 | + |
| 147 | +### max(FLOAT, FLOAT) |
| 148 | +> Returns `FLOAT` |
| 149 | +
|
| 150 | +Returns the larger of the two numbers |
| 151 | + |
| 152 | + |
| 153 | +```js |
| 154 | +🚀 > Math.max(5.0, 10.0) |
| 155 | +=> 10.0 |
| 156 | +``` |
| 157 | + |
| 158 | + |
| 159 | +### min(FLOAT, FLOAT) |
| 160 | +> Returns `FLOAT` |
| 161 | +
|
| 162 | +Returns the smaller of the two numbers |
| 163 | + |
| 164 | + |
| 165 | +```js |
| 166 | +🚀 > Math.min(5.0, 10.0) |
| 167 | +=> 5.0 |
| 168 | +``` |
| 169 | + |
| 170 | + |
| 171 | +### pow(FLOAT, FLOAT) |
| 172 | +> Returns `FLOAT` |
| 173 | +
|
| 174 | +Returns argument1**argument2, the base-argument1 exponential of argument2 |
| 175 | + |
| 176 | + |
| 177 | +```js |
| 178 | +🚀 > Math.pow(2.0, 3.0) |
| 179 | +=> 8.0 |
| 180 | +``` |
| 181 | + |
| 182 | + |
| 183 | +### rand() |
| 184 | +> Returns `FLOAT` |
| 185 | +
|
| 186 | +Returns a pseudo-random number in the half-open interval [0.0, 1.0]. |
| 187 | + |
| 188 | + |
| 189 | +```js |
| 190 | +🚀 > Math.rand() |
| 191 | +=> 0.6046602879796196 |
| 192 | +``` |
| 193 | + |
| 194 | + |
| 195 | +### remainder(FLOAT, FLOAT) |
| 196 | +> Returns `FLOAT` |
| 197 | +
|
| 198 | +Returns the IEEE 754 floating-point remainder of argument1/argument2 |
| 199 | + |
| 200 | + |
| 201 | +```js |
| 202 | +🚀 > Math.remainder(100.0, 30.0) |
| 203 | +=> 10.0 |
| 204 | +``` |
| 205 | + |
| 206 | + |
| 207 | +### round(FLOAT) |
| 208 | +> Returns `FLOAT` |
| 209 | +
|
| 210 | +Returns the nearest integer, rounding half away from zero |
| 211 | + |
| 212 | + |
| 213 | +```js |
| 214 | +🚀 > Math.round(73.3) |
| 215 | +=> 73.0 |
| 216 | +``` |
| 217 | + |
| 218 | + |
| 219 | +### sin(FLOAT) |
| 220 | +> Returns `FLOAT` |
| 221 | +
|
| 222 | +Returns the sine of the radion argument |
| 223 | + |
| 224 | + |
| 225 | +```js |
| 226 | +🚀 > Math.sin(Pi) |
| 227 | +=> 0.0 |
| 228 | +``` |
| 229 | + |
| 230 | + |
| 231 | +### sqrt(FLOAT) |
| 232 | +> Returns `FLOAT` |
| 233 | +
|
| 234 | +Returns the square root of argument |
| 235 | + |
| 236 | + |
| 237 | +```js |
| 238 | +🚀 > Math.sqrt(3.0 * 3.0 + 4.0 * 4.0) |
| 239 | +=> 5.0 |
| 240 | +``` |
| 241 | + |
| 242 | + |
| 243 | +### tan(FLOAT) |
| 244 | +> Returns `FLOAT` |
| 245 | +
|
| 246 | +Returns the tangent of the radion argument |
| 247 | + |
| 248 | + |
| 249 | +```js |
| 250 | +🚀 > Math.tan(0.0) |
| 251 | +=> 0.0 |
| 252 | +``` |
| 253 | + |
| 254 | + |
| 255 | + |
| 256 | +## Properties |
| 257 | +| Name | Value | |
| 258 | +| ---- | ----- | |
| 259 | +| E | 2.718281828459045 | |
| 260 | +| Ln10 | 2.302585092994046 | |
| 261 | +| Ln2 | 0.6931471805599453 | |
| 262 | +| Log10E | 0.4342944819032518 | |
| 263 | +| Log2E | 1.4426950408889634 | |
| 264 | +| Phi | 1.618033988749895 | |
| 265 | +| Pi | 3.141592653589793 | |
| 266 | +| Sqrt2 | 1.4142135623730951 | |
| 267 | +| SqrtE | 1.6487212707001282 | |
| 268 | +| SqrtPhi | 1.272019649514069 | |
| 269 | +| SqrtPi | 1.772453850905516 | |
0 commit comments