@grain/stdlib 0.7.0 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/array.md +491 -491
- package/bigint.md +198 -198
- package/buffer.gr +66 -1
- package/buffer.md +395 -272
- package/bytes.gr +1 -0
- package/bytes.md +200 -199
- package/char.md +125 -125
- package/exception.md +9 -9
- package/float32.md +195 -195
- package/float64.md +195 -195
- package/fs.md +115 -115
- package/hash.md +16 -16
- package/int16.md +155 -155
- package/int32.gr +1 -1
- package/int32.md +207 -207
- package/int64.gr +1 -1
- package/int64.md +207 -207
- package/int8.md +155 -155
- package/json.md +59 -59
- package/list.md +347 -347
- package/map.md +222 -222
- package/marshal.md +12 -12
- package/number.gr +119 -5
- package/number.md +503 -261
- package/option.md +141 -141
- package/package.json +2 -2
- package/path.gr +82 -65
- package/path.md +210 -141
- package/pervasives.md +238 -238
- package/priorityqueue.md +112 -112
- package/queue.md +117 -117
- package/random.md +37 -37
- package/range.md +36 -36
- package/rational.md +107 -107
- package/regex.md +91 -91
- package/result.md +102 -102
- package/runtime/atof/decimal.md +6 -6
- package/runtime/compare.md +7 -7
- package/runtime/dataStructures.md +178 -178
- package/runtime/equal.md +7 -7
- package/runtime/exception.md +15 -15
- package/runtime/malloc.md +9 -9
- package/runtime/numbers.md +269 -269
- package/runtime/string.md +17 -17
- package/runtime/unsafe/conv.md +6 -6
- package/runtime/unsafe/memory.gr +2 -19
- package/runtime/unsafe/memory.md +10 -10
- package/runtime/utf8.md +31 -31
- package/runtime/wasi.md +9 -9
- package/set.md +211 -211
- package/stack.md +122 -122
- package/string.md +228 -228
- package/uint16.md +148 -148
- package/uint32.md +192 -192
- package/uint64.md +192 -192
- package/uint8.md +148 -148
- package/uri.md +77 -77
- package/wasi/file.md +269 -269
- package/wasi/process.md +21 -21
- package/wasi/random.md +9 -9
- package/wasi/time.md +12 -12
package/number.md
CHANGED
|
@@ -143,21 +143,21 @@ Computes the sum of its operands.
|
|
|
143
143
|
|
|
144
144
|
Parameters:
|
|
145
145
|
|
|
146
|
-
|param|type|description|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
146
|
+
| param | type | description |
|
|
147
|
+
| ------ | -------- | ------------------ |
|
|
148
|
+
| `num1` | `Number` | The first operand |
|
|
149
|
+
| `num2` | `Number` | The second operand |
|
|
150
150
|
|
|
151
151
|
Returns:
|
|
152
152
|
|
|
153
|
-
|type|description|
|
|
154
|
-
|
|
155
|
-
|
|
153
|
+
| type | description |
|
|
154
|
+
| -------- | --------------------------- |
|
|
155
|
+
| `Number` | The sum of the two operands |
|
|
156
156
|
|
|
157
157
|
Examples:
|
|
158
158
|
|
|
159
159
|
```grain
|
|
160
|
-
|
|
160
|
+
use Number.{ (+) }
|
|
161
161
|
assert 1 + 2 == 3
|
|
162
162
|
```
|
|
163
163
|
|
|
@@ -183,21 +183,21 @@ Computes the difference of its operands.
|
|
|
183
183
|
|
|
184
184
|
Parameters:
|
|
185
185
|
|
|
186
|
-
|param|type|description|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
186
|
+
| param | type | description |
|
|
187
|
+
| ------ | -------- | ------------------ |
|
|
188
|
+
| `num1` | `Number` | The first operand |
|
|
189
|
+
| `num2` | `Number` | The second operand |
|
|
190
190
|
|
|
191
191
|
Returns:
|
|
192
192
|
|
|
193
|
-
|type|description|
|
|
194
|
-
|
|
195
|
-
|
|
193
|
+
| type | description |
|
|
194
|
+
| -------- | ---------------------------------- |
|
|
195
|
+
| `Number` | The difference of the two operands |
|
|
196
196
|
|
|
197
197
|
Examples:
|
|
198
198
|
|
|
199
199
|
```grain
|
|
200
|
-
|
|
200
|
+
use Number.{ (-) }
|
|
201
201
|
assert 5 - 2 == 3
|
|
202
202
|
```
|
|
203
203
|
|
|
@@ -223,21 +223,21 @@ Computes the product of its operands.
|
|
|
223
223
|
|
|
224
224
|
Parameters:
|
|
225
225
|
|
|
226
|
-
|param|type|description|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
226
|
+
| param | type | description |
|
|
227
|
+
| ------ | -------- | ------------------ |
|
|
228
|
+
| `num1` | `Number` | The first operand |
|
|
229
|
+
| `num2` | `Number` | The second operand |
|
|
230
230
|
|
|
231
231
|
Returns:
|
|
232
232
|
|
|
233
|
-
|type|description|
|
|
234
|
-
|
|
235
|
-
|
|
233
|
+
| type | description |
|
|
234
|
+
| -------- | ------------------------------- |
|
|
235
|
+
| `Number` | The product of the two operands |
|
|
236
236
|
|
|
237
237
|
Examples:
|
|
238
238
|
|
|
239
239
|
```grain
|
|
240
|
-
|
|
240
|
+
use Number.{ (*) }
|
|
241
241
|
assert 5 * 4 == 20
|
|
242
242
|
```
|
|
243
243
|
|
|
@@ -263,24 +263,58 @@ Computes the quotient of its operands.
|
|
|
263
263
|
|
|
264
264
|
Parameters:
|
|
265
265
|
|
|
266
|
-
|param|type|description|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
266
|
+
| param | type | description |
|
|
267
|
+
| ------ | -------- | ------------ |
|
|
268
|
+
| `num1` | `Number` | The dividend |
|
|
269
|
+
| `num2` | `Number` | The divisor |
|
|
270
270
|
|
|
271
271
|
Returns:
|
|
272
272
|
|
|
273
|
-
|type|description|
|
|
274
|
-
|
|
275
|
-
|
|
273
|
+
| type | description |
|
|
274
|
+
| -------- | -------------------------------- |
|
|
275
|
+
| `Number` | The quotient of the two operands |
|
|
276
276
|
|
|
277
277
|
Examples:
|
|
278
278
|
|
|
279
279
|
```grain
|
|
280
|
-
|
|
280
|
+
use Number.{ (/) }
|
|
281
281
|
assert 10 / 2.5 == 4
|
|
282
282
|
```
|
|
283
283
|
|
|
284
|
+
### Number.**(%)**
|
|
285
|
+
|
|
286
|
+
<details disabled>
|
|
287
|
+
<summary tabindex="-1">Added in <code>0.7.1</code></summary>
|
|
288
|
+
No other changes yet.
|
|
289
|
+
</details>
|
|
290
|
+
|
|
291
|
+
```grain
|
|
292
|
+
(%): (num1: Number, num2: Number) => Number
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
Computes the remainder of the division of the first operand by the second.
|
|
296
|
+
The result will have the sign of the second operand.
|
|
297
|
+
|
|
298
|
+
Parameters:
|
|
299
|
+
|
|
300
|
+
| param | type | description |
|
|
301
|
+
| ------ | -------- | ------------------ |
|
|
302
|
+
| `num1` | `Number` | The first operand |
|
|
303
|
+
| `num2` | `Number` | The second operand |
|
|
304
|
+
|
|
305
|
+
Returns:
|
|
306
|
+
|
|
307
|
+
| type | description |
|
|
308
|
+
| -------- | --------------------------- |
|
|
309
|
+
| `Number` | The modulus of its operands |
|
|
310
|
+
|
|
311
|
+
Examples:
|
|
312
|
+
|
|
313
|
+
```grain
|
|
314
|
+
use Number.{ (%) }
|
|
315
|
+
assert 10 % 3 == 1
|
|
316
|
+
```
|
|
317
|
+
|
|
284
318
|
### Number.**(\*\*)**
|
|
285
319
|
|
|
286
320
|
<details>
|
|
@@ -303,24 +337,232 @@ Computes the exponentiation of the given base and power.
|
|
|
303
337
|
|
|
304
338
|
Parameters:
|
|
305
339
|
|
|
306
|
-
|param|type|description|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
340
|
+
| param | type | description |
|
|
341
|
+
| ------- | -------- | ------------------- |
|
|
342
|
+
| `base` | `Number` | The base number |
|
|
343
|
+
| `power` | `Number` | The exponent number |
|
|
310
344
|
|
|
311
345
|
Returns:
|
|
312
346
|
|
|
313
|
-
|type|description|
|
|
314
|
-
|
|
315
|
-
|
|
347
|
+
| type | description |
|
|
348
|
+
| -------- | ---------------------------------- |
|
|
349
|
+
| `Number` | The base raised to the given power |
|
|
316
350
|
|
|
317
351
|
Examples:
|
|
318
352
|
|
|
319
353
|
```grain
|
|
320
|
-
|
|
354
|
+
use Number.{ (**) }
|
|
321
355
|
assert 10 ** 2 == 100
|
|
322
356
|
```
|
|
323
357
|
|
|
358
|
+
### Number.**(==)**
|
|
359
|
+
|
|
360
|
+
<details disabled>
|
|
361
|
+
<summary tabindex="-1">Added in <code>0.7.1</code></summary>
|
|
362
|
+
No other changes yet.
|
|
363
|
+
</details>
|
|
364
|
+
|
|
365
|
+
```grain
|
|
366
|
+
(==): (x: Number, y: Number) => Bool
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
Checks if the first value is equal to the second value.
|
|
370
|
+
|
|
371
|
+
Parameters:
|
|
372
|
+
|
|
373
|
+
| param | type | description |
|
|
374
|
+
| ----- | -------- | ---------------- |
|
|
375
|
+
| `x` | `Number` | The first value |
|
|
376
|
+
| `y` | `Number` | The second value |
|
|
377
|
+
|
|
378
|
+
Returns:
|
|
379
|
+
|
|
380
|
+
| type | description |
|
|
381
|
+
| ------ | --------------------------------------------------------------------------- |
|
|
382
|
+
| `Bool` | `true` if the first value is equal to the second value or `false` otherwise |
|
|
383
|
+
|
|
384
|
+
Examples:
|
|
385
|
+
|
|
386
|
+
```grain
|
|
387
|
+
use Number.{ (==) }
|
|
388
|
+
assert 1 == 1
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
### Number.**(!=)**
|
|
392
|
+
|
|
393
|
+
<details disabled>
|
|
394
|
+
<summary tabindex="-1">Added in <code>0.7.1</code></summary>
|
|
395
|
+
No other changes yet.
|
|
396
|
+
</details>
|
|
397
|
+
|
|
398
|
+
```grain
|
|
399
|
+
(!=): (x: Number, y: Number) => Bool
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
Checks if the first value is equal to the second value.
|
|
403
|
+
|
|
404
|
+
Parameters:
|
|
405
|
+
|
|
406
|
+
| param | type | description |
|
|
407
|
+
| ----- | -------- | ---------------- |
|
|
408
|
+
| `x` | `Number` | The first value |
|
|
409
|
+
| `y` | `Number` | The second value |
|
|
410
|
+
|
|
411
|
+
Returns:
|
|
412
|
+
|
|
413
|
+
| type | description |
|
|
414
|
+
| ------ | --------------------------------------------------------------------------- |
|
|
415
|
+
| `Bool` | `true` if the first value is equal to the second value or `false` otherwise |
|
|
416
|
+
|
|
417
|
+
Examples:
|
|
418
|
+
|
|
419
|
+
```grain
|
|
420
|
+
use Number.{ (==) }
|
|
421
|
+
assert 1 == 1
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
### Number.**(<)**
|
|
425
|
+
|
|
426
|
+
<details disabled>
|
|
427
|
+
<summary tabindex="-1">Added in <code>0.7.1</code></summary>
|
|
428
|
+
No other changes yet.
|
|
429
|
+
</details>
|
|
430
|
+
|
|
431
|
+
```grain
|
|
432
|
+
(<): (num1: Number, num2: Number) => Bool
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
Checks if the first value is less than the second value.
|
|
436
|
+
|
|
437
|
+
Parameters:
|
|
438
|
+
|
|
439
|
+
| param | type | description |
|
|
440
|
+
| ------ | -------- | ---------------- |
|
|
441
|
+
| `num1` | `Number` | The first value |
|
|
442
|
+
| `num2` | `Number` | The second value |
|
|
443
|
+
|
|
444
|
+
Returns:
|
|
445
|
+
|
|
446
|
+
| type | description |
|
|
447
|
+
| ------ | ---------------------------------------------------------------------------- |
|
|
448
|
+
| `Bool` | `true` if the first value is less than the second value or `false` otherwise |
|
|
449
|
+
|
|
450
|
+
Examples:
|
|
451
|
+
|
|
452
|
+
```grain
|
|
453
|
+
use Number.{ (<) }
|
|
454
|
+
assert 1 < 5
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
### Number.**(>)**
|
|
458
|
+
|
|
459
|
+
<details disabled>
|
|
460
|
+
<summary tabindex="-1">Added in <code>0.7.1</code></summary>
|
|
461
|
+
No other changes yet.
|
|
462
|
+
</details>
|
|
463
|
+
|
|
464
|
+
```grain
|
|
465
|
+
(>): (num1: Number, num2: Number) => Bool
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
Checks if the first value is greater than the second value.
|
|
469
|
+
|
|
470
|
+
Parameters:
|
|
471
|
+
|
|
472
|
+
| param | type | description |
|
|
473
|
+
| ------ | -------- | ---------------- |
|
|
474
|
+
| `num1` | `Number` | The first value |
|
|
475
|
+
| `num2` | `Number` | The second value |
|
|
476
|
+
|
|
477
|
+
Returns:
|
|
478
|
+
|
|
479
|
+
| type | description |
|
|
480
|
+
| ------ | ------------------------------------------------------------------------------- |
|
|
481
|
+
| `Bool` | `true` if the first value is greater than the second value or `false` otherwise |
|
|
482
|
+
|
|
483
|
+
Examples:
|
|
484
|
+
|
|
485
|
+
```grain
|
|
486
|
+
use Number.{ (>) }
|
|
487
|
+
assert 5 > 1
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
### Number.**(<=)**
|
|
491
|
+
|
|
492
|
+
<details disabled>
|
|
493
|
+
<summary tabindex="-1">Added in <code>0.7.1</code></summary>
|
|
494
|
+
No other changes yet.
|
|
495
|
+
</details>
|
|
496
|
+
|
|
497
|
+
```grain
|
|
498
|
+
(<=): (num1: Number, num2: Number) => Bool
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
Checks if the first value is less than or equal to the second value.
|
|
502
|
+
|
|
503
|
+
Parameters:
|
|
504
|
+
|
|
505
|
+
| param | type | description |
|
|
506
|
+
| ------ | -------- | ---------------- |
|
|
507
|
+
| `num1` | `Number` | The first value |
|
|
508
|
+
| `num2` | `Number` | The second value |
|
|
509
|
+
|
|
510
|
+
Returns:
|
|
511
|
+
|
|
512
|
+
| type | description |
|
|
513
|
+
| ------ | ---------------------------------------------------------------------------------------- |
|
|
514
|
+
| `Bool` | `true` if the first value is less than or equal to the second value or `false` otherwise |
|
|
515
|
+
|
|
516
|
+
Examples:
|
|
517
|
+
|
|
518
|
+
```grain
|
|
519
|
+
use Number.{ (<=) }
|
|
520
|
+
assert 1 <= 2
|
|
521
|
+
```
|
|
522
|
+
|
|
523
|
+
```grain
|
|
524
|
+
use Number.{ (<=) }
|
|
525
|
+
assert 1 <= 1
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
### Number.**(>=)**
|
|
529
|
+
|
|
530
|
+
<details disabled>
|
|
531
|
+
<summary tabindex="-1">Added in <code>0.7.1</code></summary>
|
|
532
|
+
No other changes yet.
|
|
533
|
+
</details>
|
|
534
|
+
|
|
535
|
+
```grain
|
|
536
|
+
(>=): (num1: Number, num2: Number) => Bool
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
Checks if the first value is greater than or equal to the second value.
|
|
540
|
+
|
|
541
|
+
Parameters:
|
|
542
|
+
|
|
543
|
+
| param | type | description |
|
|
544
|
+
| ------ | -------- | ---------------- |
|
|
545
|
+
| `num1` | `Number` | The first value |
|
|
546
|
+
| `num2` | `Number` | The second value |
|
|
547
|
+
|
|
548
|
+
Returns:
|
|
549
|
+
|
|
550
|
+
| type | description |
|
|
551
|
+
| ------ | ------------------------------------------------------------------------------------------- |
|
|
552
|
+
| `Bool` | `true` if the first value is greater than or equal to the second value or `false` otherwise |
|
|
553
|
+
|
|
554
|
+
Examples:
|
|
555
|
+
|
|
556
|
+
```grain
|
|
557
|
+
use Number.{ (>=) }
|
|
558
|
+
assert 3 >= 2
|
|
559
|
+
```
|
|
560
|
+
|
|
561
|
+
```grain
|
|
562
|
+
use Number.{ (>=) }
|
|
563
|
+
assert 1 >= 1
|
|
564
|
+
```
|
|
565
|
+
|
|
324
566
|
### Number.**exp**
|
|
325
567
|
|
|
326
568
|
<details disabled>
|
|
@@ -336,15 +578,15 @@ Computes the exponentiation of Euler's number to the given power.
|
|
|
336
578
|
|
|
337
579
|
Parameters:
|
|
338
580
|
|
|
339
|
-
|param|type|description|
|
|
340
|
-
|
|
341
|
-
|
|
581
|
+
| param | type | description |
|
|
582
|
+
| ------- | -------- | ------------------- |
|
|
583
|
+
| `power` | `Number` | The exponent number |
|
|
342
584
|
|
|
343
585
|
Returns:
|
|
344
586
|
|
|
345
|
-
|type|description|
|
|
346
|
-
|
|
347
|
-
|
|
587
|
+
| type | description |
|
|
588
|
+
| -------- | ---------------------------------------------- |
|
|
589
|
+
| `Number` | The `Number.e` value raised to the given power |
|
|
348
590
|
|
|
349
591
|
Examples:
|
|
350
592
|
|
|
@@ -371,15 +613,15 @@ Computes the square root of its operand.
|
|
|
371
613
|
|
|
372
614
|
Parameters:
|
|
373
615
|
|
|
374
|
-
|param|type|description|
|
|
375
|
-
|
|
376
|
-
|
|
616
|
+
| param | type | description |
|
|
617
|
+
| ----- | -------- | ------------------------- |
|
|
618
|
+
| `x` | `Number` | The number to square root |
|
|
377
619
|
|
|
378
620
|
Returns:
|
|
379
621
|
|
|
380
|
-
|type|description|
|
|
381
|
-
|
|
382
|
-
|
|
622
|
+
| type | description |
|
|
623
|
+
| -------- | ------------------------------ |
|
|
624
|
+
| `Number` | The square root of the operand |
|
|
383
625
|
|
|
384
626
|
Examples:
|
|
385
627
|
|
|
@@ -402,15 +644,15 @@ Determine the positivity or negativity of a Number.
|
|
|
402
644
|
|
|
403
645
|
Parameters:
|
|
404
646
|
|
|
405
|
-
|param|type|description|
|
|
406
|
-
|
|
407
|
-
|
|
647
|
+
| param | type | description |
|
|
648
|
+
| ----- | -------- | --------------------- |
|
|
649
|
+
| `x` | `Number` | The number to inspect |
|
|
408
650
|
|
|
409
651
|
Returns:
|
|
410
652
|
|
|
411
|
-
|type|description|
|
|
412
|
-
|
|
413
|
-
|
|
653
|
+
| type | description |
|
|
654
|
+
| -------- | ---------------------------------------------------------------------------------------------------- |
|
|
655
|
+
| `Number` | `-1` if the number is negative, `1` if positive, or `0` otherwise; signedness of `-0.0` is preserved |
|
|
414
656
|
|
|
415
657
|
Examples:
|
|
416
658
|
|
|
@@ -448,16 +690,16 @@ Returns the smaller of its operands.
|
|
|
448
690
|
|
|
449
691
|
Parameters:
|
|
450
692
|
|
|
451
|
-
|param|type|description|
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
693
|
+
| param | type | description |
|
|
694
|
+
| ----- | -------- | ------------------ |
|
|
695
|
+
| `x` | `Number` | The first operand |
|
|
696
|
+
| `y` | `Number` | The second operand |
|
|
455
697
|
|
|
456
698
|
Returns:
|
|
457
699
|
|
|
458
|
-
|type|description|
|
|
459
|
-
|
|
460
|
-
|
|
700
|
+
| type | description |
|
|
701
|
+
| -------- | ------------------------------- |
|
|
702
|
+
| `Number` | The smaller of the two operands |
|
|
461
703
|
|
|
462
704
|
Examples:
|
|
463
705
|
|
|
@@ -487,16 +729,16 @@ Returns the larger of its operands.
|
|
|
487
729
|
|
|
488
730
|
Parameters:
|
|
489
731
|
|
|
490
|
-
|param|type|description|
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
732
|
+
| param | type | description |
|
|
733
|
+
| ----- | -------- | ------------------ |
|
|
734
|
+
| `x` | `Number` | The first operand |
|
|
735
|
+
| `y` | `Number` | The second operand |
|
|
494
736
|
|
|
495
737
|
Returns:
|
|
496
738
|
|
|
497
|
-
|type|description|
|
|
498
|
-
|
|
499
|
-
|
|
739
|
+
| type | description |
|
|
740
|
+
| -------- | ------------------------------ |
|
|
741
|
+
| `Number` | The larger of the two operands |
|
|
500
742
|
|
|
501
743
|
Examples:
|
|
502
744
|
|
|
@@ -526,15 +768,15 @@ Rounds its operand up to the next largest integer.
|
|
|
526
768
|
|
|
527
769
|
Parameters:
|
|
528
770
|
|
|
529
|
-
|param|type|description|
|
|
530
|
-
|
|
531
|
-
|
|
771
|
+
| param | type | description |
|
|
772
|
+
| ----- | -------- | ------------------- |
|
|
773
|
+
| `x` | `Number` | The number to round |
|
|
532
774
|
|
|
533
775
|
Returns:
|
|
534
776
|
|
|
535
|
-
|type|description|
|
|
536
|
-
|
|
537
|
-
|
|
777
|
+
| type | description |
|
|
778
|
+
| -------- | --------------------------------------- |
|
|
779
|
+
| `Number` | The next largest integer of the operand |
|
|
538
780
|
|
|
539
781
|
Examples:
|
|
540
782
|
|
|
@@ -568,15 +810,15 @@ Rounds its operand down to the largest integer less than the operand.
|
|
|
568
810
|
|
|
569
811
|
Parameters:
|
|
570
812
|
|
|
571
|
-
|param|type|description|
|
|
572
|
-
|
|
573
|
-
|
|
813
|
+
| param | type | description |
|
|
814
|
+
| ----- | -------- | ------------------- |
|
|
815
|
+
| `x` | `Number` | The number to round |
|
|
574
816
|
|
|
575
817
|
Returns:
|
|
576
818
|
|
|
577
|
-
|type|description|
|
|
578
|
-
|
|
579
|
-
|
|
819
|
+
| type | description |
|
|
820
|
+
| -------- | ----------------------------------- |
|
|
821
|
+
| `Number` | The previous integer of the operand |
|
|
580
822
|
|
|
581
823
|
Examples:
|
|
582
824
|
|
|
@@ -610,15 +852,15 @@ Returns the integer part of its operand, removing any fractional value.
|
|
|
610
852
|
|
|
611
853
|
Parameters:
|
|
612
854
|
|
|
613
|
-
|param|type|description|
|
|
614
|
-
|
|
615
|
-
|
|
855
|
+
| param | type | description |
|
|
856
|
+
| ----- | -------- | ---------------------- |
|
|
857
|
+
| `x` | `Number` | The number to truncate |
|
|
616
858
|
|
|
617
859
|
Returns:
|
|
618
860
|
|
|
619
|
-
|type|description|
|
|
620
|
-
|
|
621
|
-
|
|
861
|
+
| type | description |
|
|
862
|
+
| -------- | ------------------------------- |
|
|
863
|
+
| `Number` | The integer part of the operand |
|
|
622
864
|
|
|
623
865
|
Examples:
|
|
624
866
|
|
|
@@ -648,15 +890,15 @@ Returns its operand rounded to its nearest integer.
|
|
|
648
890
|
|
|
649
891
|
Parameters:
|
|
650
892
|
|
|
651
|
-
|param|type|description|
|
|
652
|
-
|
|
653
|
-
|
|
893
|
+
| param | type | description |
|
|
894
|
+
| ----- | -------- | ------------------- |
|
|
895
|
+
| `x` | `Number` | The number to round |
|
|
654
896
|
|
|
655
897
|
Returns:
|
|
656
898
|
|
|
657
|
-
|type|description|
|
|
658
|
-
|
|
659
|
-
|
|
899
|
+
| type | description |
|
|
900
|
+
| -------- | ---------------------------------- |
|
|
901
|
+
| `Number` | The nearest integer to the operand |
|
|
660
902
|
|
|
661
903
|
Examples:
|
|
662
904
|
|
|
@@ -691,15 +933,15 @@ Returns the absolute value of a number. That is, it returns `x` if `x` is positi
|
|
|
691
933
|
|
|
692
934
|
Parameters:
|
|
693
935
|
|
|
694
|
-
|param|type|description|
|
|
695
|
-
|
|
696
|
-
|
|
936
|
+
| param | type | description |
|
|
937
|
+
| ----- | -------- | ----------- |
|
|
938
|
+
| `x` | `Number` | The operand |
|
|
697
939
|
|
|
698
940
|
Returns:
|
|
699
941
|
|
|
700
|
-
|type|description|
|
|
701
|
-
|
|
702
|
-
|
|
942
|
+
| type | description |
|
|
943
|
+
| -------- | --------------------------------- |
|
|
944
|
+
| `Number` | The absolute value of the operand |
|
|
703
945
|
|
|
704
946
|
Examples:
|
|
705
947
|
|
|
@@ -726,15 +968,15 @@ Returns the negation of its operand.
|
|
|
726
968
|
|
|
727
969
|
Parameters:
|
|
728
970
|
|
|
729
|
-
|param|type|description|
|
|
730
|
-
|
|
731
|
-
|
|
971
|
+
| param | type | description |
|
|
972
|
+
| ----- | -------- | -------------------- |
|
|
973
|
+
| `x` | `Number` | The number to negate |
|
|
732
974
|
|
|
733
975
|
Returns:
|
|
734
976
|
|
|
735
|
-
|type|description|
|
|
736
|
-
|
|
737
|
-
|
|
977
|
+
| type | description |
|
|
978
|
+
| -------- | ------------------- |
|
|
979
|
+
| `Number` | The negated operand |
|
|
738
980
|
|
|
739
981
|
Examples:
|
|
740
982
|
|
|
@@ -761,15 +1003,15 @@ Checks if a number is a floating point value.
|
|
|
761
1003
|
|
|
762
1004
|
Parameters:
|
|
763
1005
|
|
|
764
|
-
|param|type|description|
|
|
765
|
-
|
|
766
|
-
|
|
1006
|
+
| param | type | description |
|
|
1007
|
+
| ----- | -------- | ------------------- |
|
|
1008
|
+
| `x` | `Number` | The number to check |
|
|
767
1009
|
|
|
768
1010
|
Returns:
|
|
769
1011
|
|
|
770
|
-
|type|description|
|
|
771
|
-
|
|
772
|
-
|
|
1012
|
+
| type | description |
|
|
1013
|
+
| ------ | ------------------------------------------------------------------- |
|
|
1014
|
+
| `Bool` | `true` if the value is a floating point number or `false` otherwise |
|
|
773
1015
|
|
|
774
1016
|
Examples:
|
|
775
1017
|
|
|
@@ -812,15 +1054,15 @@ Checks if a number is an integer.
|
|
|
812
1054
|
|
|
813
1055
|
Parameters:
|
|
814
1056
|
|
|
815
|
-
|param|type|description|
|
|
816
|
-
|
|
817
|
-
|
|
1057
|
+
| param | type | description |
|
|
1058
|
+
| ----- | -------- | ------------------- |
|
|
1059
|
+
| `x` | `Number` | The number to check |
|
|
818
1060
|
|
|
819
1061
|
Returns:
|
|
820
1062
|
|
|
821
|
-
|type|description|
|
|
822
|
-
|
|
823
|
-
|
|
1063
|
+
| type | description |
|
|
1064
|
+
| ------ | ------------------------------------------------------ |
|
|
1065
|
+
| `Bool` | `true` if the value is an integer or `false` otherwise |
|
|
824
1066
|
|
|
825
1067
|
Examples:
|
|
826
1068
|
|
|
@@ -863,15 +1105,15 @@ Checks if a number is a non-integer rational value.
|
|
|
863
1105
|
|
|
864
1106
|
Parameters:
|
|
865
1107
|
|
|
866
|
-
|param|type|description|
|
|
867
|
-
|
|
868
|
-
|
|
1108
|
+
| param | type | description |
|
|
1109
|
+
| ----- | -------- | ------------------- |
|
|
1110
|
+
| `x` | `Number` | The number to check |
|
|
869
1111
|
|
|
870
1112
|
Returns:
|
|
871
1113
|
|
|
872
|
-
|type|description|
|
|
873
|
-
|
|
874
|
-
|
|
1114
|
+
| type | description |
|
|
1115
|
+
| ------ | ------------------------------------------------------------------------- |
|
|
1116
|
+
| `Bool` | `true` if the value is a non-integer rational number or `false` otherwise |
|
|
875
1117
|
|
|
876
1118
|
Examples:
|
|
877
1119
|
|
|
@@ -915,15 +1157,15 @@ All values are finite exept for floating point NaN, infinity or negative infinit
|
|
|
915
1157
|
|
|
916
1158
|
Parameters:
|
|
917
1159
|
|
|
918
|
-
|param|type|description|
|
|
919
|
-
|
|
920
|
-
|
|
1160
|
+
| param | type | description |
|
|
1161
|
+
| ----- | -------- | ------------------- |
|
|
1162
|
+
| `x` | `Number` | The number to check |
|
|
921
1163
|
|
|
922
1164
|
Returns:
|
|
923
1165
|
|
|
924
|
-
|type|description|
|
|
925
|
-
|
|
926
|
-
|
|
1166
|
+
| type | description |
|
|
1167
|
+
| ------ | -------------------------------------------------- |
|
|
1168
|
+
| `Bool` | `true` if the value is finite or `false` otherwise |
|
|
927
1169
|
|
|
928
1170
|
Examples:
|
|
929
1171
|
|
|
@@ -970,15 +1212,15 @@ Checks if a number is the float NaN value (Not A Number).
|
|
|
970
1212
|
|
|
971
1213
|
Parameters:
|
|
972
1214
|
|
|
973
|
-
|param|type|description|
|
|
974
|
-
|
|
975
|
-
|
|
1215
|
+
| param | type | description |
|
|
1216
|
+
| ----- | -------- | ------------------- |
|
|
1217
|
+
| `x` | `Number` | The number to check |
|
|
976
1218
|
|
|
977
1219
|
Returns:
|
|
978
1220
|
|
|
979
|
-
|type|description|
|
|
980
|
-
|
|
981
|
-
|
|
1221
|
+
| type | description |
|
|
1222
|
+
| ------ | --------------------------------------------- |
|
|
1223
|
+
| `Bool` | `true` if the value is NaN, otherwise `false` |
|
|
982
1224
|
|
|
983
1225
|
Examples:
|
|
984
1226
|
|
|
@@ -1026,15 +1268,15 @@ Note that this function is not the exact opposite of isFinite(Number) in that it
|
|
|
1026
1268
|
|
|
1027
1269
|
Parameters:
|
|
1028
1270
|
|
|
1029
|
-
|param|type|description|
|
|
1030
|
-
|
|
1031
|
-
|
|
1271
|
+
| param | type | description |
|
|
1272
|
+
| ----- | -------- | ------------------- |
|
|
1273
|
+
| `x` | `Number` | The number to check |
|
|
1032
1274
|
|
|
1033
1275
|
Returns:
|
|
1034
1276
|
|
|
1035
|
-
|type|description|
|
|
1036
|
-
|
|
1037
|
-
|
|
1277
|
+
| type | description |
|
|
1278
|
+
| ------ | ---------------------------------------------------- |
|
|
1279
|
+
| `Bool` | `true` if the value is infinite or `false` otherwise |
|
|
1038
1280
|
|
|
1039
1281
|
Examples:
|
|
1040
1282
|
|
|
@@ -1083,18 +1325,18 @@ Determines whether two values are considered close to each other using a relativ
|
|
|
1083
1325
|
|
|
1084
1326
|
Parameters:
|
|
1085
1327
|
|
|
1086
|
-
|param|type|description|
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1328
|
+
| param | type | description |
|
|
1329
|
+
| -------------------- | -------- | ----------------------------------------------------------------------------- |
|
|
1330
|
+
| `a` | `Number` | The first value |
|
|
1331
|
+
| `b` | `Number` | The second value |
|
|
1332
|
+
| `?relativeTolerance` | `Number` | The maximum tolerance to use relative to the larger absolute value `a` or `b` |
|
|
1333
|
+
| `?absoluteTolerance` | `Number` | The absolute tolerance to use, regardless of the values of `a` or `b` |
|
|
1092
1334
|
|
|
1093
1335
|
Returns:
|
|
1094
1336
|
|
|
1095
|
-
|type|description|
|
|
1096
|
-
|
|
1097
|
-
|
|
1337
|
+
| type | description |
|
|
1338
|
+
| ------ | ---------------------------------------------------------------------------- |
|
|
1339
|
+
| `Bool` | `true` if the values are considered close to each other or `false` otherwise |
|
|
1098
1340
|
|
|
1099
1341
|
Examples:
|
|
1100
1342
|
|
|
@@ -1159,16 +1401,16 @@ input are ignored.
|
|
|
1159
1401
|
|
|
1160
1402
|
Parameters:
|
|
1161
1403
|
|
|
1162
|
-
|param|type|description|
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1404
|
+
| param | type | description |
|
|
1405
|
+
| -------- | -------- | ----------------------------------------------------------- |
|
|
1406
|
+
| `string` | `String` | The string to parse |
|
|
1407
|
+
| `radix` | `Number` | The number system base to use when parsing the input string |
|
|
1166
1408
|
|
|
1167
1409
|
Returns:
|
|
1168
1410
|
|
|
1169
|
-
|type|description|
|
|
1170
|
-
|
|
1171
|
-
|
|
1411
|
+
| type | description |
|
|
1412
|
+
| ------------------------------------ | -------------------------------------------------------------------------------------------------------------------- |
|
|
1413
|
+
| `Result<Number, Atoi.ParseIntError>` | `Ok(value)` containing the parsed number on a successful parse or `Err(err)` containing a variant of `ParseIntError` |
|
|
1172
1414
|
|
|
1173
1415
|
Examples:
|
|
1174
1416
|
|
|
@@ -1200,15 +1442,15 @@ in numeric portions of the input are ignored.
|
|
|
1200
1442
|
|
|
1201
1443
|
Parameters:
|
|
1202
1444
|
|
|
1203
|
-
|param|type|description|
|
|
1204
|
-
|
|
1205
|
-
|
|
1445
|
+
| param | type | description |
|
|
1446
|
+
| -------- | -------- | ------------------- |
|
|
1447
|
+
| `string` | `String` | The string to parse |
|
|
1206
1448
|
|
|
1207
1449
|
Returns:
|
|
1208
1450
|
|
|
1209
|
-
|type|description|
|
|
1210
|
-
|
|
1211
|
-
|
|
1451
|
+
| type | description |
|
|
1452
|
+
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------- |
|
|
1453
|
+
| `Result<Number, String>` | `Ok(value)` containing the parsed number on a successful parse or `Err(msg)` containing an error message string otherwise |
|
|
1212
1454
|
|
|
1213
1455
|
Examples:
|
|
1214
1456
|
|
|
@@ -1240,15 +1482,15 @@ Underscores that appear in the numeric portion of the input are ignored.
|
|
|
1240
1482
|
|
|
1241
1483
|
Parameters:
|
|
1242
1484
|
|
|
1243
|
-
|param|type|description|
|
|
1244
|
-
|
|
1245
|
-
|
|
1485
|
+
| param | type | description |
|
|
1486
|
+
| ------- | -------- | ------------------- |
|
|
1487
|
+
| `input` | `String` | The string to parse |
|
|
1246
1488
|
|
|
1247
1489
|
Returns:
|
|
1248
1490
|
|
|
1249
|
-
|type|description|
|
|
1250
|
-
|
|
1251
|
-
|
|
1491
|
+
| type | description |
|
|
1492
|
+
| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------- |
|
|
1493
|
+
| `Result<Number, Atoi.ParseIntError>` | `Ok(value)` containing the parsed number on a successful parse or `Err(msg)` containing an error message string otherwise |
|
|
1252
1494
|
|
|
1253
1495
|
Examples:
|
|
1254
1496
|
|
|
@@ -1283,15 +1525,15 @@ Computes the inverse sine of the given angle.
|
|
|
1283
1525
|
|
|
1284
1526
|
Parameters:
|
|
1285
1527
|
|
|
1286
|
-
|param|type|description|
|
|
1287
|
-
|
|
1288
|
-
|
|
1528
|
+
| param | type | description |
|
|
1529
|
+
| ------- | -------- | -------------------------------------------------------------- |
|
|
1530
|
+
| `angle` | `Number` | A number between -1 and 1, representing the angle's sine value |
|
|
1289
1531
|
|
|
1290
1532
|
Returns:
|
|
1291
1533
|
|
|
1292
|
-
|type|description|
|
|
1293
|
-
|
|
1294
|
-
|
|
1534
|
+
| type | description |
|
|
1535
|
+
| -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1536
|
+
| `Number` | The inverse sine (angle in radians between `-pi/2` and `pi/2`) of the given `angle` or `NaN` if the given `angle` is not between`-1` and `1` |
|
|
1295
1537
|
|
|
1296
1538
|
Examples:
|
|
1297
1539
|
|
|
@@ -1318,15 +1560,15 @@ Computes the inverse cosine of the given angle.
|
|
|
1318
1560
|
|
|
1319
1561
|
Parameters:
|
|
1320
1562
|
|
|
1321
|
-
|param|type|description|
|
|
1322
|
-
|
|
1323
|
-
|
|
1563
|
+
| param | type | description |
|
|
1564
|
+
| ------- | -------- | ---------------------------------------------------------------- |
|
|
1565
|
+
| `angle` | `Number` | A number between -1 and 1, representing the angle's cosine value |
|
|
1324
1566
|
|
|
1325
1567
|
Returns:
|
|
1326
1568
|
|
|
1327
|
-
|type|description|
|
|
1328
|
-
|
|
1329
|
-
|
|
1569
|
+
| type | description |
|
|
1570
|
+
| -------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1571
|
+
| `Number` | The inverse cosine (angle in radians between `-pi/2` and `pi/2`) of the given `angle` or `NaN` if the given `angle` is not between`-1` and `1` |
|
|
1330
1572
|
|
|
1331
1573
|
Examples:
|
|
1332
1574
|
|
|
@@ -1353,15 +1595,15 @@ Computes the inverse tangent of the given angle.
|
|
|
1353
1595
|
|
|
1354
1596
|
Parameters:
|
|
1355
1597
|
|
|
1356
|
-
|param|type|description|
|
|
1357
|
-
|
|
1358
|
-
|
|
1598
|
+
| param | type | description |
|
|
1599
|
+
| ------- | -------- | ----------------------------------------------------------------- |
|
|
1600
|
+
| `angle` | `Number` | A number between -1 and 1, representing the angle's tangent value |
|
|
1359
1601
|
|
|
1360
1602
|
Returns:
|
|
1361
1603
|
|
|
1362
|
-
|type|description|
|
|
1363
|
-
|
|
1364
|
-
|
|
1604
|
+
| type | description |
|
|
1605
|
+
| -------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1606
|
+
| `Number` | The inverse tangent (angle in radians between `-pi/2` and `pi/2`) of the given `angle` or `NaN` if the given `angle` is not between`-1` and `1` |
|
|
1365
1607
|
|
|
1366
1608
|
Examples:
|
|
1367
1609
|
|
|
@@ -1388,16 +1630,16 @@ Computes the angle between the positive x-axis and the ray from the origin to th
|
|
|
1388
1630
|
|
|
1389
1631
|
Parameters:
|
|
1390
1632
|
|
|
1391
|
-
|param|type|description|
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1633
|
+
| param | type | description |
|
|
1634
|
+
| ----- | -------- | ---------------------- |
|
|
1635
|
+
| `y` | `Number` | The given y coordinate |
|
|
1636
|
+
| `x` | `Number` | The given x coordinate |
|
|
1395
1637
|
|
|
1396
1638
|
Returns:
|
|
1397
1639
|
|
|
1398
|
-
|type|description|
|
|
1399
|
-
|
|
1400
|
-
|
|
1640
|
+
| type | description |
|
|
1641
|
+
| -------- | --------------------------------------------------------------------- |
|
|
1642
|
+
| `Number` | The angle in radians between the positive x-axis and the point (x, y) |
|
|
1401
1643
|
|
|
1402
1644
|
Examples:
|
|
1403
1645
|
|
|
@@ -1420,15 +1662,15 @@ Converts degrees to radians.
|
|
|
1420
1662
|
|
|
1421
1663
|
Parameters:
|
|
1422
1664
|
|
|
1423
|
-
|param|type|description|
|
|
1424
|
-
|
|
1425
|
-
|
|
1665
|
+
| param | type | description |
|
|
1666
|
+
| --------- | -------- | -------------------- |
|
|
1667
|
+
| `degrees` | `Number` | The value to convert |
|
|
1426
1668
|
|
|
1427
1669
|
Returns:
|
|
1428
1670
|
|
|
1429
|
-
|type|description|
|
|
1430
|
-
|
|
1431
|
-
|
|
1671
|
+
| type | description |
|
|
1672
|
+
| -------- | -------------------- |
|
|
1673
|
+
| `Number` | The value in radians |
|
|
1432
1674
|
|
|
1433
1675
|
Examples:
|
|
1434
1676
|
|
|
@@ -1451,15 +1693,15 @@ Converts radians to degrees.
|
|
|
1451
1693
|
|
|
1452
1694
|
Parameters:
|
|
1453
1695
|
|
|
1454
|
-
|param|type|description|
|
|
1455
|
-
|
|
1456
|
-
|
|
1696
|
+
| param | type | description |
|
|
1697
|
+
| --------- | -------- | -------------------- |
|
|
1698
|
+
| `radians` | `Number` | The value to convert |
|
|
1457
1699
|
|
|
1458
1700
|
Returns:
|
|
1459
1701
|
|
|
1460
|
-
|type|description|
|
|
1461
|
-
|
|
1462
|
-
|
|
1702
|
+
| type | description |
|
|
1703
|
+
| -------- | -------------------- |
|
|
1704
|
+
| `Number` | The value in degrees |
|
|
1463
1705
|
|
|
1464
1706
|
Examples:
|
|
1465
1707
|
|
|
@@ -1482,16 +1724,16 @@ Constrains a number within the given inclusive range.
|
|
|
1482
1724
|
|
|
1483
1725
|
Parameters:
|
|
1484
1726
|
|
|
1485
|
-
|param|type|description|
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1727
|
+
| param | type | description |
|
|
1728
|
+
| ------- | --------------- | ----------------------------------- |
|
|
1729
|
+
| `range` | `Range<Number>` | The inclusive range to clamp within |
|
|
1730
|
+
| `input` | `Number` | The number to clamp |
|
|
1489
1731
|
|
|
1490
1732
|
Returns:
|
|
1491
1733
|
|
|
1492
|
-
|type|description|
|
|
1493
|
-
|
|
1494
|
-
|
|
1734
|
+
| type | description |
|
|
1735
|
+
| -------- | ---------------------- |
|
|
1736
|
+
| `Number` | The constrained number |
|
|
1495
1737
|
|
|
1496
1738
|
### Number.**linearInterpolate**
|
|
1497
1739
|
|
|
@@ -1508,16 +1750,16 @@ Maps a weight between 0 and 1 within the given inclusive range.
|
|
|
1508
1750
|
|
|
1509
1751
|
Parameters:
|
|
1510
1752
|
|
|
1511
|
-
|param|type|description|
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1753
|
+
| param | type | description |
|
|
1754
|
+
| -------- | --------------- | ----------------------------------------- |
|
|
1755
|
+
| `range` | `Range<Number>` | The inclusive range to interpolate within |
|
|
1756
|
+
| `weight` | `Number` | The weight to interpolate |
|
|
1515
1757
|
|
|
1516
1758
|
Returns:
|
|
1517
1759
|
|
|
1518
|
-
|type|description|
|
|
1519
|
-
|
|
1520
|
-
|
|
1760
|
+
| type | description |
|
|
1761
|
+
| -------- | ----------------- |
|
|
1762
|
+
| `Number` | The blended value |
|
|
1521
1763
|
|
|
1522
1764
|
Throws:
|
|
1523
1765
|
|
|
@@ -1545,17 +1787,17 @@ If the number is outside the input range, it will be clamped.
|
|
|
1545
1787
|
|
|
1546
1788
|
Parameters:
|
|
1547
1789
|
|
|
1548
|
-
|param|type|description|
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1790
|
+
| param | type | description |
|
|
1791
|
+
| ------------- | --------------- | ---------------------------------------- |
|
|
1792
|
+
| `inputRange` | `Range<Number>` | The inclusive range you are mapping from |
|
|
1793
|
+
| `outputRange` | `Range<Number>` | The inclusive range you are mapping to |
|
|
1794
|
+
| `current` | `Number` | The number to map |
|
|
1553
1795
|
|
|
1554
1796
|
Returns:
|
|
1555
1797
|
|
|
1556
|
-
|type|description|
|
|
1557
|
-
|
|
1558
|
-
|
|
1798
|
+
| type | description |
|
|
1799
|
+
| -------- | ----------------- |
|
|
1800
|
+
| `Number` | The mapped number |
|
|
1559
1801
|
|
|
1560
1802
|
Throws:
|
|
1561
1803
|
|
|
@@ -1581,15 +1823,15 @@ Computes the sine of a number (in radians).
|
|
|
1581
1823
|
|
|
1582
1824
|
Parameters:
|
|
1583
1825
|
|
|
1584
|
-
|param|type|description|
|
|
1585
|
-
|
|
1586
|
-
|
|
1826
|
+
| param | type | description |
|
|
1827
|
+
| --------- | -------- | -------------------- |
|
|
1828
|
+
| `radians` | `Number` | The input in radians |
|
|
1587
1829
|
|
|
1588
1830
|
Returns:
|
|
1589
1831
|
|
|
1590
|
-
|type|description|
|
|
1591
|
-
|
|
1592
|
-
|
|
1832
|
+
| type | description |
|
|
1833
|
+
| -------- | ----------------- |
|
|
1834
|
+
| `Number` | The computed sine |
|
|
1593
1835
|
|
|
1594
1836
|
Examples:
|
|
1595
1837
|
|
|
@@ -1612,15 +1854,15 @@ Computes the cosine of a number (in radians).
|
|
|
1612
1854
|
|
|
1613
1855
|
Parameters:
|
|
1614
1856
|
|
|
1615
|
-
|param|type|description|
|
|
1616
|
-
|
|
1617
|
-
|
|
1857
|
+
| param | type | description |
|
|
1858
|
+
| --------- | -------- | -------------------- |
|
|
1859
|
+
| `radians` | `Number` | The input in radians |
|
|
1618
1860
|
|
|
1619
1861
|
Returns:
|
|
1620
1862
|
|
|
1621
|
-
|type|description|
|
|
1622
|
-
|
|
1623
|
-
|
|
1863
|
+
| type | description |
|
|
1864
|
+
| -------- | ------------------- |
|
|
1865
|
+
| `Number` | The computed cosine |
|
|
1624
1866
|
|
|
1625
1867
|
Examples:
|
|
1626
1868
|
|
|
@@ -1643,15 +1885,15 @@ Computes the tangent of a number (in radians).
|
|
|
1643
1885
|
|
|
1644
1886
|
Parameters:
|
|
1645
1887
|
|
|
1646
|
-
|param|type|description|
|
|
1647
|
-
|
|
1648
|
-
|
|
1888
|
+
| param | type | description |
|
|
1889
|
+
| --------- | -------- | -------------------- |
|
|
1890
|
+
| `radians` | `Number` | The input in radians |
|
|
1649
1891
|
|
|
1650
1892
|
Returns:
|
|
1651
1893
|
|
|
1652
|
-
|type|description|
|
|
1653
|
-
|
|
1654
|
-
|
|
1894
|
+
| type | description |
|
|
1895
|
+
| -------- | -------------------- |
|
|
1896
|
+
| `Number` | The computed tangent |
|
|
1655
1897
|
|
|
1656
1898
|
Examples:
|
|
1657
1899
|
|
|
@@ -1674,15 +1916,15 @@ Computes the gamma function of a value using the Lanczos approximation.
|
|
|
1674
1916
|
|
|
1675
1917
|
Parameters:
|
|
1676
1918
|
|
|
1677
|
-
|param|type|description|
|
|
1678
|
-
|
|
1679
|
-
|
|
1919
|
+
| param | type | description |
|
|
1920
|
+
| ----- | -------- | ------------------------ |
|
|
1921
|
+
| `z` | `Number` | The value to interpolate |
|
|
1680
1922
|
|
|
1681
1923
|
Returns:
|
|
1682
1924
|
|
|
1683
|
-
|type|description|
|
|
1684
|
-
|
|
1685
|
-
|
|
1925
|
+
| type | description |
|
|
1926
|
+
| -------- | ---------------------------- |
|
|
1927
|
+
| `Number` | The gamma of the given value |
|
|
1686
1928
|
|
|
1687
1929
|
Examples:
|
|
1688
1930
|
|
|
@@ -1713,15 +1955,15 @@ Computes the factorial of an integer input or the gamma function of a non-intege
|
|
|
1713
1955
|
|
|
1714
1956
|
Parameters:
|
|
1715
1957
|
|
|
1716
|
-
|param|type|description|
|
|
1717
|
-
|
|
1718
|
-
|
|
1958
|
+
| param | type | description |
|
|
1959
|
+
| ----- | -------- | ------------------------- |
|
|
1960
|
+
| `n` | `Number` | The value to factorialize |
|
|
1719
1961
|
|
|
1720
1962
|
Returns:
|
|
1721
1963
|
|
|
1722
|
-
|type|description|
|
|
1723
|
-
|
|
1724
|
-
|
|
1964
|
+
| type | description |
|
|
1965
|
+
| -------- | -------------------------------- |
|
|
1966
|
+
| `Number` | The factorial of the given value |
|
|
1725
1967
|
|
|
1726
1968
|
Throws:
|
|
1727
1969
|
|