@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/bigint.md
CHANGED
|
@@ -44,15 +44,15 @@ Converts a Number to a BigInt.
|
|
|
44
44
|
|
|
45
45
|
Parameters:
|
|
46
46
|
|
|
47
|
-
|param|type|description|
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
| param | type | description |
|
|
48
|
+
| -------- | -------- | -------------------- |
|
|
49
|
+
| `number` | `Number` | The value to convert |
|
|
50
50
|
|
|
51
51
|
Returns:
|
|
52
52
|
|
|
53
|
-
|type|description|
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
| type | description |
|
|
54
|
+
| -------- | ---------------------------------- |
|
|
55
|
+
| `BigInt` | The Number represented as a BigInt |
|
|
56
56
|
|
|
57
57
|
### BigInt.**toNumber**
|
|
58
58
|
|
|
@@ -69,15 +69,15 @@ Converts a BigInt to a Number.
|
|
|
69
69
|
|
|
70
70
|
Parameters:
|
|
71
71
|
|
|
72
|
-
|param|type|description|
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
| param | type | description |
|
|
73
|
+
| ----- | -------- | -------------------- |
|
|
74
|
+
| `num` | `BigInt` | The value to convert |
|
|
75
75
|
|
|
76
76
|
Returns:
|
|
77
77
|
|
|
78
|
-
|type|description|
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
| type | description |
|
|
79
|
+
| -------- | ---------------------------------- |
|
|
80
|
+
| `Number` | The BigInt represented as a Number |
|
|
81
81
|
|
|
82
82
|
### BigInt.**incr**
|
|
83
83
|
|
|
@@ -94,15 +94,15 @@ Increments the value by one.
|
|
|
94
94
|
|
|
95
95
|
Parameters:
|
|
96
96
|
|
|
97
|
-
|param|type|description|
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
| param | type | description |
|
|
98
|
+
| ----- | -------- | ---------------------- |
|
|
99
|
+
| `num` | `BigInt` | The value to increment |
|
|
100
100
|
|
|
101
101
|
Returns:
|
|
102
102
|
|
|
103
|
-
|type|description|
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
| type | description |
|
|
104
|
+
| -------- | --------------------- |
|
|
105
|
+
| `BigInt` | The incremented value |
|
|
106
106
|
|
|
107
107
|
Examples:
|
|
108
108
|
|
|
@@ -129,15 +129,15 @@ Decrements the value by one.
|
|
|
129
129
|
|
|
130
130
|
Parameters:
|
|
131
131
|
|
|
132
|
-
|param|type|description|
|
|
133
|
-
|
|
134
|
-
|
|
132
|
+
| param | type | description |
|
|
133
|
+
| ----- | -------- | ---------------------- |
|
|
134
|
+
| `num` | `BigInt` | The value to decrement |
|
|
135
135
|
|
|
136
136
|
Returns:
|
|
137
137
|
|
|
138
|
-
|type|description|
|
|
139
|
-
|
|
140
|
-
|
|
138
|
+
| type | description |
|
|
139
|
+
| -------- | --------------------- |
|
|
140
|
+
| `BigInt` | The decremented value |
|
|
141
141
|
|
|
142
142
|
Examples:
|
|
143
143
|
|
|
@@ -164,15 +164,15 @@ Negates the given operand.
|
|
|
164
164
|
|
|
165
165
|
Parameters:
|
|
166
166
|
|
|
167
|
-
|param|type|description|
|
|
168
|
-
|
|
169
|
-
|
|
167
|
+
| param | type | description |
|
|
168
|
+
| ----- | -------- | ----------- |
|
|
169
|
+
| `num` | `BigInt` | The operand |
|
|
170
170
|
|
|
171
171
|
Returns:
|
|
172
172
|
|
|
173
|
-
|type|description|
|
|
174
|
-
|
|
175
|
-
|
|
173
|
+
| type | description |
|
|
174
|
+
| -------- | ------------------- |
|
|
175
|
+
| `BigInt` | The negated operand |
|
|
176
176
|
|
|
177
177
|
Examples:
|
|
178
178
|
|
|
@@ -199,15 +199,15 @@ Returns the absolute value of the given operand.
|
|
|
199
199
|
|
|
200
200
|
Parameters:
|
|
201
201
|
|
|
202
|
-
|param|type|description|
|
|
203
|
-
|
|
204
|
-
|
|
202
|
+
| param | type | description |
|
|
203
|
+
| ----- | -------- | ----------- |
|
|
204
|
+
| `num` | `BigInt` | The operand |
|
|
205
205
|
|
|
206
206
|
Returns:
|
|
207
207
|
|
|
208
|
-
|type|description|
|
|
209
|
-
|
|
210
|
-
|
|
208
|
+
| type | description |
|
|
209
|
+
| -------- | ---------------------------- |
|
|
210
|
+
| `BigInt` | The operand's absolute value |
|
|
211
211
|
|
|
212
212
|
Examples:
|
|
213
213
|
|
|
@@ -241,16 +241,16 @@ Computes the sum of its operands.
|
|
|
241
241
|
|
|
242
242
|
Parameters:
|
|
243
243
|
|
|
244
|
-
|param|type|description|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
244
|
+
| param | type | description |
|
|
245
|
+
| ------ | -------- | ------------------ |
|
|
246
|
+
| `num1` | `BigInt` | The first operand |
|
|
247
|
+
| `num2` | `BigInt` | The second operand |
|
|
248
248
|
|
|
249
249
|
Returns:
|
|
250
250
|
|
|
251
|
-
|type|description|
|
|
252
|
-
|
|
253
|
-
|
|
251
|
+
| type | description |
|
|
252
|
+
| -------- | --------------------------- |
|
|
253
|
+
| `BigInt` | The sum of the two operands |
|
|
254
254
|
|
|
255
255
|
Examples:
|
|
256
256
|
|
|
@@ -281,16 +281,16 @@ Computes the difference of its operands.
|
|
|
281
281
|
|
|
282
282
|
Parameters:
|
|
283
283
|
|
|
284
|
-
|param|type|description|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
284
|
+
| param | type | description |
|
|
285
|
+
| ------ | -------- | ------------------ |
|
|
286
|
+
| `num1` | `BigInt` | The first operand |
|
|
287
|
+
| `num2` | `BigInt` | The second operand |
|
|
288
288
|
|
|
289
289
|
Returns:
|
|
290
290
|
|
|
291
|
-
|type|description|
|
|
292
|
-
|
|
293
|
-
|
|
291
|
+
| type | description |
|
|
292
|
+
| -------- | ---------------------------------- |
|
|
293
|
+
| `BigInt` | The difference of the two operands |
|
|
294
294
|
|
|
295
295
|
Examples:
|
|
296
296
|
|
|
@@ -321,16 +321,16 @@ Computes the product of its operands.
|
|
|
321
321
|
|
|
322
322
|
Parameters:
|
|
323
323
|
|
|
324
|
-
|param|type|description|
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
324
|
+
| param | type | description |
|
|
325
|
+
| ------ | -------- | ------------------ |
|
|
326
|
+
| `num1` | `BigInt` | The first operand |
|
|
327
|
+
| `num2` | `BigInt` | The second operand |
|
|
328
328
|
|
|
329
329
|
Returns:
|
|
330
330
|
|
|
331
|
-
|type|description|
|
|
332
|
-
|
|
333
|
-
|
|
331
|
+
| type | description |
|
|
332
|
+
| -------- | ------------------------------- |
|
|
333
|
+
| `BigInt` | The product of the two operands |
|
|
334
334
|
|
|
335
335
|
Examples:
|
|
336
336
|
|
|
@@ -362,16 +362,16 @@ Computes the quotient of its operands using signed (truncated) division
|
|
|
362
362
|
|
|
363
363
|
Parameters:
|
|
364
364
|
|
|
365
|
-
|param|type|description|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
365
|
+
| param | type | description |
|
|
366
|
+
| ------ | -------- | ------------------ |
|
|
367
|
+
| `num1` | `BigInt` | The first operand |
|
|
368
|
+
| `num2` | `BigInt` | The second operand |
|
|
369
369
|
|
|
370
370
|
Returns:
|
|
371
371
|
|
|
372
|
-
|type|description|
|
|
373
|
-
|
|
374
|
-
|
|
372
|
+
| type | description |
|
|
373
|
+
| -------- | ---------------------------- |
|
|
374
|
+
| `BigInt` | The quotient of its operands |
|
|
375
375
|
|
|
376
376
|
Examples:
|
|
377
377
|
|
|
@@ -396,16 +396,16 @@ Computes the remainder of the division of its operands using signed (truncated)
|
|
|
396
396
|
|
|
397
397
|
Parameters:
|
|
398
398
|
|
|
399
|
-
|param|type|description|
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
399
|
+
| param | type | description |
|
|
400
|
+
| ------ | -------- | ------------------ |
|
|
401
|
+
| `num1` | `BigInt` | The first operand |
|
|
402
|
+
| `num2` | `BigInt` | The second operand |
|
|
403
403
|
|
|
404
404
|
Returns:
|
|
405
405
|
|
|
406
|
-
|type|description|
|
|
407
|
-
|
|
408
|
-
|
|
406
|
+
| type | description |
|
|
407
|
+
| -------- | ----------------------------- |
|
|
408
|
+
| `BigInt` | The remainder of its operands |
|
|
409
409
|
|
|
410
410
|
Examples:
|
|
411
411
|
|
|
@@ -428,16 +428,16 @@ Computes the quotient and remainder of its operands using signed (truncated) div
|
|
|
428
428
|
|
|
429
429
|
Parameters:
|
|
430
430
|
|
|
431
|
-
|param|type|description|
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
431
|
+
| param | type | description |
|
|
432
|
+
| ------ | -------- | ------------------ |
|
|
433
|
+
| `num1` | `BigInt` | The first operand |
|
|
434
|
+
| `num2` | `BigInt` | The second operand |
|
|
435
435
|
|
|
436
436
|
Returns:
|
|
437
437
|
|
|
438
|
-
|type|description|
|
|
439
|
-
|
|
440
|
-
|
|
438
|
+
| type | description |
|
|
439
|
+
| ------------------ | ------------------------------------------ |
|
|
440
|
+
| `(BigInt, BigInt)` | The quotient and remainder of its operands |
|
|
441
441
|
|
|
442
442
|
Examples:
|
|
443
443
|
|
|
@@ -460,16 +460,16 @@ Computes the greatest common divisior of the two operands.
|
|
|
460
460
|
|
|
461
461
|
Parameters:
|
|
462
462
|
|
|
463
|
-
|param|type|description|
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
463
|
+
| param | type | description |
|
|
464
|
+
| ------ | -------- | ------------------ |
|
|
465
|
+
| `num1` | `BigInt` | The first operand |
|
|
466
|
+
| `num2` | `BigInt` | The second operand |
|
|
467
467
|
|
|
468
468
|
Returns:
|
|
469
469
|
|
|
470
|
-
|type|description|
|
|
471
|
-
|
|
472
|
-
|
|
470
|
+
| type | description |
|
|
471
|
+
| -------- | ------------------------------------------- |
|
|
472
|
+
| `BigInt` | The greatest common divisor of its operands |
|
|
473
473
|
|
|
474
474
|
Examples:
|
|
475
475
|
|
|
@@ -499,16 +499,16 @@ Shifts the bits of the value left by the given number of bits.
|
|
|
499
499
|
|
|
500
500
|
Parameters:
|
|
501
501
|
|
|
502
|
-
|param|type|description|
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
502
|
+
| param | type | description |
|
|
503
|
+
| -------- | -------- | ------------------------------ |
|
|
504
|
+
| `num` | `BigInt` | The value to shift |
|
|
505
|
+
| `places` | `Int32` | The number of bits to shift by |
|
|
506
506
|
|
|
507
507
|
Returns:
|
|
508
508
|
|
|
509
|
-
|type|description|
|
|
510
|
-
|
|
511
|
-
|
|
509
|
+
| type | description |
|
|
510
|
+
| -------- | ----------------- |
|
|
511
|
+
| `BigInt` | The shifted value |
|
|
512
512
|
|
|
513
513
|
Examples:
|
|
514
514
|
|
|
@@ -539,16 +539,16 @@ Shifts the bits of the value right by the given number of bits, preserving the s
|
|
|
539
539
|
|
|
540
540
|
Parameters:
|
|
541
541
|
|
|
542
|
-
|param|type|description|
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
542
|
+
| param | type | description |
|
|
543
|
+
| -------- | -------- | ---------------------- |
|
|
544
|
+
| `num` | `BigInt` | The value to shift |
|
|
545
|
+
| `places` | `Int32` | The amount to shift by |
|
|
546
546
|
|
|
547
547
|
Returns:
|
|
548
548
|
|
|
549
|
-
|type|description|
|
|
550
|
-
|
|
551
|
-
|
|
549
|
+
| type | description |
|
|
550
|
+
| -------- | ----------------- |
|
|
551
|
+
| `BigInt` | The shifted value |
|
|
552
552
|
|
|
553
553
|
Examples:
|
|
554
554
|
|
|
@@ -572,15 +572,15 @@ Checks if the given value is equal to zero.
|
|
|
572
572
|
|
|
573
573
|
Parameters:
|
|
574
574
|
|
|
575
|
-
|param|type|description|
|
|
576
|
-
|
|
577
|
-
|
|
575
|
+
| param | type | description |
|
|
576
|
+
| ----- | -------- | -------------------- |
|
|
577
|
+
| `num` | `BigInt` | The value to inspect |
|
|
578
578
|
|
|
579
579
|
Returns:
|
|
580
580
|
|
|
581
|
-
|type|description|
|
|
582
|
-
|
|
583
|
-
|
|
581
|
+
| type | description |
|
|
582
|
+
| ------ | --------------------------------------------------------------- |
|
|
583
|
+
| `Bool` | `true` if the first value is equal to zero or `false` otherwise |
|
|
584
584
|
|
|
585
585
|
Examples:
|
|
586
586
|
|
|
@@ -614,16 +614,16 @@ Checks if the first value is equal to the second value.
|
|
|
614
614
|
|
|
615
615
|
Parameters:
|
|
616
616
|
|
|
617
|
-
|param|type|description|
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
617
|
+
| param | type | description |
|
|
618
|
+
| ------ | -------- | ---------------- |
|
|
619
|
+
| `num1` | `BigInt` | The first value |
|
|
620
|
+
| `num2` | `BigInt` | The second value |
|
|
621
621
|
|
|
622
622
|
Returns:
|
|
623
623
|
|
|
624
|
-
|type|description|
|
|
625
|
-
|
|
626
|
-
|
|
624
|
+
| type | description |
|
|
625
|
+
| ------ | --------------------------------------------------------------------------- |
|
|
626
|
+
| `Bool` | `true` if the first value is equal to the second value or `false` otherwise |
|
|
627
627
|
|
|
628
628
|
Examples:
|
|
629
629
|
|
|
@@ -659,16 +659,16 @@ Checks if the first value is not equal to the second value.
|
|
|
659
659
|
|
|
660
660
|
Parameters:
|
|
661
661
|
|
|
662
|
-
|param|type|description|
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
662
|
+
| param | type | description |
|
|
663
|
+
| ------ | -------- | ---------------- |
|
|
664
|
+
| `num1` | `BigInt` | The first value |
|
|
665
|
+
| `num2` | `BigInt` | The second value |
|
|
666
666
|
|
|
667
667
|
Returns:
|
|
668
668
|
|
|
669
|
-
|type|description|
|
|
670
|
-
|
|
671
|
-
|
|
669
|
+
| type | description |
|
|
670
|
+
| ------ | ------------------------------------------------------------------------------- |
|
|
671
|
+
| `Bool` | `true` if the first value is not equal to the second value or `false` otherwise |
|
|
672
672
|
|
|
673
673
|
Examples:
|
|
674
674
|
|
|
@@ -704,16 +704,16 @@ Checks if the first value is less than the second value.
|
|
|
704
704
|
|
|
705
705
|
Parameters:
|
|
706
706
|
|
|
707
|
-
|param|type|description|
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
707
|
+
| param | type | description |
|
|
708
|
+
| ------ | -------- | ---------------- |
|
|
709
|
+
| `num1` | `BigInt` | The first value |
|
|
710
|
+
| `num2` | `BigInt` | The second value |
|
|
711
711
|
|
|
712
712
|
Returns:
|
|
713
713
|
|
|
714
|
-
|type|description|
|
|
715
|
-
|
|
716
|
-
|
|
714
|
+
| type | description |
|
|
715
|
+
| ------ | ---------------------------------------------------------------------------- |
|
|
716
|
+
| `Bool` | `true` if the first value is less than the second value or `false` otherwise |
|
|
717
717
|
|
|
718
718
|
Examples:
|
|
719
719
|
|
|
@@ -749,16 +749,16 @@ Checks if the first value is less than or equal to the second value.
|
|
|
749
749
|
|
|
750
750
|
Parameters:
|
|
751
751
|
|
|
752
|
-
|param|type|description|
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
752
|
+
| param | type | description |
|
|
753
|
+
| ------ | -------- | ---------------- |
|
|
754
|
+
| `num1` | `BigInt` | The first value |
|
|
755
|
+
| `num2` | `BigInt` | The second value |
|
|
756
756
|
|
|
757
757
|
Returns:
|
|
758
758
|
|
|
759
|
-
|type|description|
|
|
760
|
-
|
|
761
|
-
|
|
759
|
+
| type | description |
|
|
760
|
+
| ------ | ---------------------------------------------------------------------------------------- |
|
|
761
|
+
| `Bool` | `true` if the first value is less than or equal to the second value or `false` otherwise |
|
|
762
762
|
|
|
763
763
|
Examples:
|
|
764
764
|
|
|
@@ -799,16 +799,16 @@ Checks if the first value is greater than the second value.
|
|
|
799
799
|
|
|
800
800
|
Parameters:
|
|
801
801
|
|
|
802
|
-
|param|type|description|
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
802
|
+
| param | type | description |
|
|
803
|
+
| ------ | -------- | ---------------- |
|
|
804
|
+
| `num1` | `BigInt` | The first value |
|
|
805
|
+
| `num2` | `BigInt` | The second value |
|
|
806
806
|
|
|
807
807
|
Returns:
|
|
808
808
|
|
|
809
|
-
|type|description|
|
|
810
|
-
|
|
811
|
-
|
|
809
|
+
| type | description |
|
|
810
|
+
| ------ | ------------------------------------------------------------------------------- |
|
|
811
|
+
| `Bool` | `true` if the first value is greater than the second value or `false` otherwise |
|
|
812
812
|
|
|
813
813
|
Examples:
|
|
814
814
|
|
|
@@ -844,16 +844,16 @@ Checks if the first value is greater than or equal to the second value.
|
|
|
844
844
|
|
|
845
845
|
Parameters:
|
|
846
846
|
|
|
847
|
-
|param|type|description|
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
847
|
+
| param | type | description |
|
|
848
|
+
| ------ | -------- | ---------------- |
|
|
849
|
+
| `num1` | `BigInt` | The first value |
|
|
850
|
+
| `num2` | `BigInt` | The second value |
|
|
851
851
|
|
|
852
852
|
Returns:
|
|
853
853
|
|
|
854
|
-
|type|description|
|
|
855
|
-
|
|
856
|
-
|
|
854
|
+
| type | description |
|
|
855
|
+
| ------ | ------------------------------------------------------------------------------------------- |
|
|
856
|
+
| `Bool` | `true` if the first value is greater than or equal to the second value or `false` otherwise |
|
|
857
857
|
|
|
858
858
|
Examples:
|
|
859
859
|
|
|
@@ -887,15 +887,15 @@ Computes the bitwise NOT of the given value.
|
|
|
887
887
|
|
|
888
888
|
Parameters:
|
|
889
889
|
|
|
890
|
-
|param|type|description|
|
|
891
|
-
|
|
892
|
-
|
|
890
|
+
| param | type | description |
|
|
891
|
+
| ----- | -------- | --------------- |
|
|
892
|
+
| `num` | `BigInt` | The given value |
|
|
893
893
|
|
|
894
894
|
Returns:
|
|
895
895
|
|
|
896
|
-
|type|description|
|
|
897
|
-
|
|
898
|
-
|
|
896
|
+
| type | description |
|
|
897
|
+
| -------- | ----------------------------------------------- |
|
|
898
|
+
| `BigInt` | Containing the inverted bits of the given value |
|
|
899
899
|
|
|
900
900
|
Examples:
|
|
901
901
|
|
|
@@ -925,16 +925,16 @@ Computes the bitwise AND (`&`) on the given operands.
|
|
|
925
925
|
|
|
926
926
|
Parameters:
|
|
927
927
|
|
|
928
|
-
|param|type|description|
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
928
|
+
| param | type | description |
|
|
929
|
+
| ------ | -------- | ------------------ |
|
|
930
|
+
| `num1` | `BigInt` | The first operand |
|
|
931
|
+
| `num2` | `BigInt` | The second operand |
|
|
932
932
|
|
|
933
933
|
Returns:
|
|
934
934
|
|
|
935
|
-
|type|description|
|
|
936
|
-
|
|
937
|
-
|
|
935
|
+
| type | description |
|
|
936
|
+
| -------- | ----------------------------------------------------------------------------------------------- |
|
|
937
|
+
| `BigInt` | Containing a `1` in each bit position for which the corresponding bits of both operands are `1` |
|
|
938
938
|
|
|
939
939
|
Examples:
|
|
940
940
|
|
|
@@ -965,16 +965,16 @@ Computes the bitwise OR (`|`) on the given operands.
|
|
|
965
965
|
|
|
966
966
|
Parameters:
|
|
967
967
|
|
|
968
|
-
|param|type|description|
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
968
|
+
| param | type | description |
|
|
969
|
+
| ------ | -------- | ------------------ |
|
|
970
|
+
| `num1` | `BigInt` | The first operand |
|
|
971
|
+
| `num2` | `BigInt` | The second operand |
|
|
972
972
|
|
|
973
973
|
Returns:
|
|
974
974
|
|
|
975
|
-
|type|description|
|
|
976
|
-
|
|
977
|
-
|
|
975
|
+
| type | description |
|
|
976
|
+
| -------- | --------------------------------------------------------------------------------------------------------- |
|
|
977
|
+
| `BigInt` | Containing a `1` in each bit position for which the corresponding bits of either or both operands are `1` |
|
|
978
978
|
|
|
979
979
|
Examples:
|
|
980
980
|
|
|
@@ -1005,16 +1005,16 @@ Computes the bitwise XOR (`^`) on the given operands.
|
|
|
1005
1005
|
|
|
1006
1006
|
Parameters:
|
|
1007
1007
|
|
|
1008
|
-
|param|type|description|
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1008
|
+
| param | type | description |
|
|
1009
|
+
| ------ | -------- | ------------------ |
|
|
1010
|
+
| `num1` | `BigInt` | The first operand |
|
|
1011
|
+
| `num2` | `BigInt` | The second operand |
|
|
1012
1012
|
|
|
1013
1013
|
Returns:
|
|
1014
1014
|
|
|
1015
|
-
|type|description|
|
|
1016
|
-
|
|
1017
|
-
|
|
1015
|
+
| type | description |
|
|
1016
|
+
| -------- | -------------------------------------------------------------------------------------------------------------- |
|
|
1017
|
+
| `BigInt` | Containing a `1` in each bit position for which the corresponding bits of either but not both operands are `1` |
|
|
1018
1018
|
|
|
1019
1019
|
Examples:
|
|
1020
1020
|
|
|
@@ -1039,15 +1039,15 @@ Will return the maximum integer for negative numbers.
|
|
|
1039
1039
|
|
|
1040
1040
|
Parameters:
|
|
1041
1041
|
|
|
1042
|
-
|param|type|description|
|
|
1043
|
-
|
|
1044
|
-
|
|
1042
|
+
| param | type | description |
|
|
1043
|
+
| ----- | -------- | -------------------- |
|
|
1044
|
+
| `num` | `BigInt` | The value to inspect |
|
|
1045
1045
|
|
|
1046
1046
|
Returns:
|
|
1047
1047
|
|
|
1048
|
-
|type|description|
|
|
1049
|
-
|
|
1050
|
-
|
|
1048
|
+
| type | description |
|
|
1049
|
+
| ------- | --------------------------- |
|
|
1050
|
+
| `Int32` | The amount of leading zeros |
|
|
1051
1051
|
|
|
1052
1052
|
Examples:
|
|
1053
1053
|
|
|
@@ -1070,15 +1070,15 @@ Counts the number of trailing zero bits in the value.
|
|
|
1070
1070
|
|
|
1071
1071
|
Parameters:
|
|
1072
1072
|
|
|
1073
|
-
|param|type|description|
|
|
1074
|
-
|
|
1075
|
-
|
|
1073
|
+
| param | type | description |
|
|
1074
|
+
| ----- | -------- | -------------------- |
|
|
1075
|
+
| `num` | `BigInt` | The value to inspect |
|
|
1076
1076
|
|
|
1077
1077
|
Returns:
|
|
1078
1078
|
|
|
1079
|
-
|type|description|
|
|
1080
|
-
|
|
1081
|
-
|
|
1079
|
+
| type | description |
|
|
1080
|
+
| ------- | ---------------------------- |
|
|
1081
|
+
| `Int64` | The amount of trailing zeros |
|
|
1082
1082
|
|
|
1083
1083
|
Examples:
|
|
1084
1084
|
|
|
@@ -1102,15 +1102,15 @@ Will return the `None` if given a negative integer
|
|
|
1102
1102
|
|
|
1103
1103
|
Parameters:
|
|
1104
1104
|
|
|
1105
|
-
|param|type|description|
|
|
1106
|
-
|
|
1107
|
-
|
|
1105
|
+
| param | type | description |
|
|
1106
|
+
| ----- | -------- | -------------------- |
|
|
1107
|
+
| `num` | `BigInt` | The value to inspect |
|
|
1108
1108
|
|
|
1109
1109
|
Returns:
|
|
1110
1110
|
|
|
1111
|
-
|type|description|
|
|
1112
|
-
|
|
1113
|
-
|
|
1111
|
+
| type | description |
|
|
1112
|
+
| --------------- | ----------------------------------- |
|
|
1113
|
+
| `Option<Int64>` | The amount of 1-bits in its operand |
|
|
1114
1114
|
|
|
1115
1115
|
Examples:
|
|
1116
1116
|
|
|
@@ -1133,15 +1133,15 @@ Converts the given operand to a string.
|
|
|
1133
1133
|
|
|
1134
1134
|
Parameters:
|
|
1135
1135
|
|
|
1136
|
-
|param|type|description|
|
|
1137
|
-
|
|
1138
|
-
|
|
1136
|
+
| param | type | description |
|
|
1137
|
+
| ----- | -------- | ----------- |
|
|
1138
|
+
| `num` | `BigInt` | The operand |
|
|
1139
1139
|
|
|
1140
1140
|
Returns:
|
|
1141
1141
|
|
|
1142
|
-
|type|description|
|
|
1143
|
-
|
|
1144
|
-
|
|
1142
|
+
| type | description |
|
|
1143
|
+
| -------- | ------------------------ |
|
|
1144
|
+
| `String` | The operand, as a string |
|
|
1145
1145
|
|
|
1146
1146
|
Examples:
|
|
1147
1147
|
|