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