@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/int64.md
CHANGED
|
@@ -40,15 +40,15 @@ Converts a Number to an Int64.
|
|
|
40
40
|
|
|
41
41
|
Parameters:
|
|
42
42
|
|
|
43
|
-
|param|type|description|
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
| param | type | description |
|
|
44
|
+
| -------- | -------- | -------------------- |
|
|
45
|
+
| `number` | `Number` | The value to convert |
|
|
46
46
|
|
|
47
47
|
Returns:
|
|
48
48
|
|
|
49
|
-
|type|description|
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
| type | description |
|
|
50
|
+
| ------- | ---------------------------------- |
|
|
51
|
+
| `Int64` | The Number represented as an Int64 |
|
|
52
52
|
|
|
53
53
|
### Int64.**toNumber**
|
|
54
54
|
|
|
@@ -65,15 +65,15 @@ Converts an Int64 to a Number.
|
|
|
65
65
|
|
|
66
66
|
Parameters:
|
|
67
67
|
|
|
68
|
-
|param|type|description|
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
| param | type | description |
|
|
69
|
+
| ------- | ------- | -------------------- |
|
|
70
|
+
| `value` | `Int64` | The value to convert |
|
|
71
71
|
|
|
72
72
|
Returns:
|
|
73
73
|
|
|
74
|
-
|type|description|
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
| type | description |
|
|
75
|
+
| -------- | --------------------------------- |
|
|
76
|
+
| `Number` | The Int64 represented as a Number |
|
|
77
77
|
|
|
78
78
|
### Int64.**fromUint64**
|
|
79
79
|
|
|
@@ -90,15 +90,15 @@ Converts a Uint64 to an Int64.
|
|
|
90
90
|
|
|
91
91
|
Parameters:
|
|
92
92
|
|
|
93
|
-
|param|type|description|
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
| param | type | description |
|
|
94
|
+
| -------- | -------- | -------------------- |
|
|
95
|
+
| `number` | `Uint64` | The value to convert |
|
|
96
96
|
|
|
97
97
|
Returns:
|
|
98
98
|
|
|
99
|
-
|type|description|
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
| type | description |
|
|
100
|
+
| ------- | ---------------------------------- |
|
|
101
|
+
| `Int64` | The Uint64 represented as an Int64 |
|
|
102
102
|
|
|
103
103
|
Examples:
|
|
104
104
|
|
|
@@ -121,15 +121,15 @@ Interprets a Float64 as an Int64.
|
|
|
121
121
|
|
|
122
122
|
Parameters:
|
|
123
123
|
|
|
124
|
-
|param|type|description|
|
|
125
|
-
|
|
126
|
-
|
|
124
|
+
| param | type | description |
|
|
125
|
+
| ------- | --------- | -------------------- |
|
|
126
|
+
| `value` | `Float64` | The value to convert |
|
|
127
127
|
|
|
128
128
|
Returns:
|
|
129
129
|
|
|
130
|
-
|type|description|
|
|
131
|
-
|
|
132
|
-
|
|
130
|
+
| type | description |
|
|
131
|
+
| ------- | ----------------------------------- |
|
|
132
|
+
| `Int64` | The Float64 interpreted as an Int64 |
|
|
133
133
|
|
|
134
134
|
Examples:
|
|
135
135
|
|
|
@@ -156,15 +156,15 @@ Increments the value by one.
|
|
|
156
156
|
|
|
157
157
|
Parameters:
|
|
158
158
|
|
|
159
|
-
|param|type|description|
|
|
160
|
-
|
|
161
|
-
|
|
159
|
+
| param | type | description |
|
|
160
|
+
| ------- | ------- | ---------------------- |
|
|
161
|
+
| `value` | `Int64` | The value to increment |
|
|
162
162
|
|
|
163
163
|
Returns:
|
|
164
164
|
|
|
165
|
-
|type|description|
|
|
166
|
-
|
|
167
|
-
|
|
165
|
+
| type | description |
|
|
166
|
+
| ------- | --------------------- |
|
|
167
|
+
| `Int64` | The incremented value |
|
|
168
168
|
|
|
169
169
|
Examples:
|
|
170
170
|
|
|
@@ -191,15 +191,15 @@ Decrements the value by one.
|
|
|
191
191
|
|
|
192
192
|
Parameters:
|
|
193
193
|
|
|
194
|
-
|param|type|description|
|
|
195
|
-
|
|
196
|
-
|
|
194
|
+
| param | type | description |
|
|
195
|
+
| ------- | ------- | ---------------------- |
|
|
196
|
+
| `value` | `Int64` | The value to decrement |
|
|
197
197
|
|
|
198
198
|
Returns:
|
|
199
199
|
|
|
200
|
-
|type|description|
|
|
201
|
-
|
|
202
|
-
|
|
200
|
+
| type | description |
|
|
201
|
+
| ------- | --------------------- |
|
|
202
|
+
| `Int64` | The decremented value |
|
|
203
203
|
|
|
204
204
|
Examples:
|
|
205
205
|
|
|
@@ -233,16 +233,16 @@ Computes the sum of its operands.
|
|
|
233
233
|
|
|
234
234
|
Parameters:
|
|
235
235
|
|
|
236
|
-
|param|type|description|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
236
|
+
| param | type | description |
|
|
237
|
+
| ----- | ------- | ------------------ |
|
|
238
|
+
| `x` | `Int64` | The first operand |
|
|
239
|
+
| `y` | `Int64` | The second operand |
|
|
240
240
|
|
|
241
241
|
Returns:
|
|
242
242
|
|
|
243
|
-
|type|description|
|
|
244
|
-
|
|
245
|
-
|
|
243
|
+
| type | description |
|
|
244
|
+
| ------- | --------------------------- |
|
|
245
|
+
| `Int64` | The sum of the two operands |
|
|
246
246
|
|
|
247
247
|
Examples:
|
|
248
248
|
|
|
@@ -273,16 +273,16 @@ Computes the difference of its operands.
|
|
|
273
273
|
|
|
274
274
|
Parameters:
|
|
275
275
|
|
|
276
|
-
|param|type|description|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
276
|
+
| param | type | description |
|
|
277
|
+
| ----- | ------- | ------------------ |
|
|
278
|
+
| `x` | `Int64` | The first operand |
|
|
279
|
+
| `y` | `Int64` | The second operand |
|
|
280
280
|
|
|
281
281
|
Returns:
|
|
282
282
|
|
|
283
|
-
|type|description|
|
|
284
|
-
|
|
285
|
-
|
|
283
|
+
| type | description |
|
|
284
|
+
| ------- | ---------------------------------- |
|
|
285
|
+
| `Int64` | The difference of the two operands |
|
|
286
286
|
|
|
287
287
|
Examples:
|
|
288
288
|
|
|
@@ -313,16 +313,16 @@ Computes the product of its operands.
|
|
|
313
313
|
|
|
314
314
|
Parameters:
|
|
315
315
|
|
|
316
|
-
|param|type|description|
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
316
|
+
| param | type | description |
|
|
317
|
+
| ----- | ------- | ------------------ |
|
|
318
|
+
| `x` | `Int64` | The first operand |
|
|
319
|
+
| `y` | `Int64` | The second operand |
|
|
320
320
|
|
|
321
321
|
Returns:
|
|
322
322
|
|
|
323
|
-
|type|description|
|
|
324
|
-
|
|
325
|
-
|
|
323
|
+
| type | description |
|
|
324
|
+
| ------- | ------------------------------- |
|
|
325
|
+
| `Int64` | The product of the two operands |
|
|
326
326
|
|
|
327
327
|
Examples:
|
|
328
328
|
|
|
@@ -353,16 +353,16 @@ Computes the quotient of its operands using signed division.
|
|
|
353
353
|
|
|
354
354
|
Parameters:
|
|
355
355
|
|
|
356
|
-
|param|type|description|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
356
|
+
| param | type | description |
|
|
357
|
+
| ----- | ------- | ------------------ |
|
|
358
|
+
| `x` | `Int64` | The first operand |
|
|
359
|
+
| `y` | `Int64` | The second operand |
|
|
360
360
|
|
|
361
361
|
Returns:
|
|
362
362
|
|
|
363
|
-
|type|description|
|
|
364
|
-
|
|
365
|
-
|
|
363
|
+
| type | description |
|
|
364
|
+
| ------- | ---------------------------- |
|
|
365
|
+
| `Int64` | The quotient of its operands |
|
|
366
366
|
|
|
367
367
|
Examples:
|
|
368
368
|
|
|
@@ -386,16 +386,16 @@ Computes the remainder of the division of its operands using signed division.
|
|
|
386
386
|
|
|
387
387
|
Parameters:
|
|
388
388
|
|
|
389
|
-
|param|type|description|
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
389
|
+
| param | type | description |
|
|
390
|
+
| ----- | ------- | ------------------ |
|
|
391
|
+
| `x` | `Int64` | The first operand |
|
|
392
|
+
| `y` | `Int64` | The second operand |
|
|
393
393
|
|
|
394
394
|
Returns:
|
|
395
395
|
|
|
396
|
-
|type|description|
|
|
397
|
-
|
|
398
|
-
|
|
396
|
+
| type | description |
|
|
397
|
+
| ------- | ----------------------------- |
|
|
398
|
+
| `Int64` | The remainder of its operands |
|
|
399
399
|
|
|
400
400
|
Examples:
|
|
401
401
|
|
|
@@ -426,16 +426,16 @@ The result will have the sign of the second operand.
|
|
|
426
426
|
|
|
427
427
|
Parameters:
|
|
428
428
|
|
|
429
|
-
|param|type|description|
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
429
|
+
| param | type | description |
|
|
430
|
+
| ----- | ------- | ------------------ |
|
|
431
|
+
| `x` | `Int64` | The first operand |
|
|
432
|
+
| `y` | `Int64` | The second operand |
|
|
433
433
|
|
|
434
434
|
Returns:
|
|
435
435
|
|
|
436
|
-
|type|description|
|
|
437
|
-
|
|
438
|
-
|
|
436
|
+
| type | description |
|
|
437
|
+
| ------- | --------------------------- |
|
|
438
|
+
| `Int64` | The modulus of its operands |
|
|
439
439
|
|
|
440
440
|
Throws:
|
|
441
441
|
|
|
@@ -465,16 +465,16 @@ Rotates the bits of the value left by the given number of bits.
|
|
|
465
465
|
|
|
466
466
|
Parameters:
|
|
467
467
|
|
|
468
|
-
|param|type|description|
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
468
|
+
| param | type | description |
|
|
469
|
+
| -------- | ------- | ------------------------------- |
|
|
470
|
+
| `value` | `Int64` | The value to rotate |
|
|
471
|
+
| `amount` | `Int64` | The number of bits to rotate by |
|
|
472
472
|
|
|
473
473
|
Returns:
|
|
474
474
|
|
|
475
|
-
|type|description|
|
|
476
|
-
|
|
477
|
-
|
|
475
|
+
| type | description |
|
|
476
|
+
| ------- | ----------------- |
|
|
477
|
+
| `Int64` | The rotated value |
|
|
478
478
|
|
|
479
479
|
Examples:
|
|
480
480
|
|
|
@@ -501,16 +501,16 @@ Rotates the bits of the value right by the given number of bits.
|
|
|
501
501
|
|
|
502
502
|
Parameters:
|
|
503
503
|
|
|
504
|
-
|param|type|description|
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
504
|
+
| param | type | description |
|
|
505
|
+
| -------- | ------- | ------------------------------- |
|
|
506
|
+
| `value` | `Int64` | The value to rotate |
|
|
507
|
+
| `amount` | `Int64` | The number of bits to rotate by |
|
|
508
508
|
|
|
509
509
|
Returns:
|
|
510
510
|
|
|
511
|
-
|type|description|
|
|
512
|
-
|
|
513
|
-
|
|
511
|
+
| type | description |
|
|
512
|
+
| ------- | ----------------- |
|
|
513
|
+
| `Int64` | The rotated value |
|
|
514
514
|
|
|
515
515
|
Examples:
|
|
516
516
|
|
|
@@ -544,16 +544,16 @@ Shifts the bits of the value left by the given number of bits.
|
|
|
544
544
|
|
|
545
545
|
Parameters:
|
|
546
546
|
|
|
547
|
-
|param|type|description|
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
547
|
+
| param | type | description |
|
|
548
|
+
| -------- | ------- | ------------------------------ |
|
|
549
|
+
| `value` | `Int64` | The value to shift |
|
|
550
|
+
| `amount` | `Int64` | The number of bits to shift by |
|
|
551
551
|
|
|
552
552
|
Returns:
|
|
553
553
|
|
|
554
|
-
|type|description|
|
|
555
|
-
|
|
556
|
-
|
|
554
|
+
| type | description |
|
|
555
|
+
| ------- | ----------------- |
|
|
556
|
+
| `Int64` | The shifted value |
|
|
557
557
|
|
|
558
558
|
Examples:
|
|
559
559
|
|
|
@@ -584,16 +584,16 @@ Shifts the bits of the value right by the given number of bits, preserving the s
|
|
|
584
584
|
|
|
585
585
|
Parameters:
|
|
586
586
|
|
|
587
|
-
|param|type|description|
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
587
|
+
| param | type | description |
|
|
588
|
+
| -------- | ------- | ---------------------- |
|
|
589
|
+
| `value` | `Int64` | The value to shift |
|
|
590
|
+
| `amount` | `Int64` | The amount to shift by |
|
|
591
591
|
|
|
592
592
|
Returns:
|
|
593
593
|
|
|
594
|
-
|type|description|
|
|
595
|
-
|
|
596
|
-
|
|
594
|
+
| type | description |
|
|
595
|
+
| ------- | ----------------- |
|
|
596
|
+
| `Int64` | The shifted value |
|
|
597
597
|
|
|
598
598
|
Examples:
|
|
599
599
|
|
|
@@ -624,16 +624,16 @@ Checks if the first value is equal to the second value.
|
|
|
624
624
|
|
|
625
625
|
Parameters:
|
|
626
626
|
|
|
627
|
-
|param|type|description|
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
627
|
+
| param | type | description |
|
|
628
|
+
| ----- | ------- | ---------------- |
|
|
629
|
+
| `x` | `Int64` | The first value |
|
|
630
|
+
| `y` | `Int64` | The second value |
|
|
631
631
|
|
|
632
632
|
Returns:
|
|
633
633
|
|
|
634
|
-
|type|description|
|
|
635
|
-
|
|
636
|
-
|
|
634
|
+
| type | description |
|
|
635
|
+
| ------ | --------------------------------------------------------------------------- |
|
|
636
|
+
| `Bool` | `true` if the first value is equal to the second value or `false` otherwise |
|
|
637
637
|
|
|
638
638
|
Examples:
|
|
639
639
|
|
|
@@ -664,16 +664,16 @@ Checks if the first value is not equal to the second value.
|
|
|
664
664
|
|
|
665
665
|
Parameters:
|
|
666
666
|
|
|
667
|
-
|param|type|description|
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
667
|
+
| param | type | description |
|
|
668
|
+
| ----- | ------- | ---------------- |
|
|
669
|
+
| `x` | `Int64` | The first value |
|
|
670
|
+
| `y` | `Int64` | The second value |
|
|
671
671
|
|
|
672
672
|
Returns:
|
|
673
673
|
|
|
674
|
-
|type|description|
|
|
675
|
-
|
|
676
|
-
|
|
674
|
+
| type | description |
|
|
675
|
+
| ------ | ------------------------------------------------------------------------------- |
|
|
676
|
+
| `Bool` | `true` if the first value is not equal to the second value or `false` otherwise |
|
|
677
677
|
|
|
678
678
|
Examples:
|
|
679
679
|
|
|
@@ -697,15 +697,15 @@ Checks if the given value is equal to zero.
|
|
|
697
697
|
|
|
698
698
|
Parameters:
|
|
699
699
|
|
|
700
|
-
|param|type|description|
|
|
701
|
-
|
|
702
|
-
|
|
700
|
+
| param | type | description |
|
|
701
|
+
| ------- | ------- | -------------------- |
|
|
702
|
+
| `value` | `Int64` | The value to inspect |
|
|
703
703
|
|
|
704
704
|
Returns:
|
|
705
705
|
|
|
706
|
-
|type|description|
|
|
707
|
-
|
|
708
|
-
|
|
706
|
+
| type | description |
|
|
707
|
+
| ------ | --------------------------------------------------------------- |
|
|
708
|
+
| `Bool` | `true` if the first value is equal to zero or `false` otherwise |
|
|
709
709
|
|
|
710
710
|
Examples:
|
|
711
711
|
|
|
@@ -739,16 +739,16 @@ Checks if the first value is less than the second value.
|
|
|
739
739
|
|
|
740
740
|
Parameters:
|
|
741
741
|
|
|
742
|
-
|param|type|description|
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
742
|
+
| param | type | description |
|
|
743
|
+
| ----- | ------- | ---------------- |
|
|
744
|
+
| `x` | `Int64` | The first value |
|
|
745
|
+
| `y` | `Int64` | The second value |
|
|
746
746
|
|
|
747
747
|
Returns:
|
|
748
748
|
|
|
749
|
-
|type|description|
|
|
750
|
-
|
|
751
|
-
|
|
749
|
+
| type | description |
|
|
750
|
+
| ------ | ---------------------------------------------------------------------------- |
|
|
751
|
+
| `Bool` | `true` if the first value is less than the second value or `false` otherwise |
|
|
752
752
|
|
|
753
753
|
Examples:
|
|
754
754
|
|
|
@@ -779,16 +779,16 @@ Checks if the first value is greater than the second value.
|
|
|
779
779
|
|
|
780
780
|
Parameters:
|
|
781
781
|
|
|
782
|
-
|param|type|description|
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
782
|
+
| param | type | description |
|
|
783
|
+
| ----- | ------- | ---------------- |
|
|
784
|
+
| `x` | `Int64` | The first value |
|
|
785
|
+
| `y` | `Int64` | The second value |
|
|
786
786
|
|
|
787
787
|
Returns:
|
|
788
788
|
|
|
789
|
-
|type|description|
|
|
790
|
-
|
|
791
|
-
|
|
789
|
+
| type | description |
|
|
790
|
+
| ------ | ------------------------------------------------------------------------------- |
|
|
791
|
+
| `Bool` | `true` if the first value is greater than the second value or `false` otherwise |
|
|
792
792
|
|
|
793
793
|
Examples:
|
|
794
794
|
|
|
@@ -819,16 +819,16 @@ Checks if the first value is less than or equal to the second value.
|
|
|
819
819
|
|
|
820
820
|
Parameters:
|
|
821
821
|
|
|
822
|
-
|param|type|description|
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
822
|
+
| param | type | description |
|
|
823
|
+
| ----- | ------- | ---------------- |
|
|
824
|
+
| `x` | `Int64` | The first value |
|
|
825
|
+
| `y` | `Int64` | The second value |
|
|
826
826
|
|
|
827
827
|
Returns:
|
|
828
828
|
|
|
829
|
-
|type|description|
|
|
830
|
-
|
|
831
|
-
|
|
829
|
+
| type | description |
|
|
830
|
+
| ------ | ---------------------------------------------------------------------------------------- |
|
|
831
|
+
| `Bool` | `true` if the first value is less than or equal to the second value or `false` otherwise |
|
|
832
832
|
|
|
833
833
|
Examples:
|
|
834
834
|
|
|
@@ -864,16 +864,16 @@ Checks if the first value is greater than or equal to the second value.
|
|
|
864
864
|
|
|
865
865
|
Parameters:
|
|
866
866
|
|
|
867
|
-
|param|type|description|
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
867
|
+
| param | type | description |
|
|
868
|
+
| ----- | ------- | ---------------- |
|
|
869
|
+
| `x` | `Int64` | The first value |
|
|
870
|
+
| `y` | `Int64` | The second value |
|
|
871
871
|
|
|
872
872
|
Returns:
|
|
873
873
|
|
|
874
|
-
|type|description|
|
|
875
|
-
|
|
876
|
-
|
|
874
|
+
| type | description |
|
|
875
|
+
| ------ | ------------------------------------------------------------------------------------------- |
|
|
876
|
+
| `Bool` | `true` if the first value is greater than or equal to the second value or `false` otherwise |
|
|
877
877
|
|
|
878
878
|
Examples:
|
|
879
879
|
|
|
@@ -902,15 +902,15 @@ Computes the bitwise NOT of the given value.
|
|
|
902
902
|
|
|
903
903
|
Parameters:
|
|
904
904
|
|
|
905
|
-
|param|type|description|
|
|
906
|
-
|
|
907
|
-
|
|
905
|
+
| param | type | description |
|
|
906
|
+
| ------- | ------- | --------------- |
|
|
907
|
+
| `value` | `Int64` | The given value |
|
|
908
908
|
|
|
909
909
|
Returns:
|
|
910
910
|
|
|
911
|
-
|type|description|
|
|
912
|
-
|
|
913
|
-
|
|
911
|
+
| type | description |
|
|
912
|
+
| ------- | ----------------------------------------------- |
|
|
913
|
+
| `Int64` | Containing the inverted bits of the given value |
|
|
914
914
|
|
|
915
915
|
Examples:
|
|
916
916
|
|
|
@@ -940,16 +940,16 @@ Computes the bitwise AND (`&`) on the given operands.
|
|
|
940
940
|
|
|
941
941
|
Parameters:
|
|
942
942
|
|
|
943
|
-
|param|type|description|
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
943
|
+
| param | type | description |
|
|
944
|
+
| ----- | ------- | ------------------ |
|
|
945
|
+
| `x` | `Int64` | The first operand |
|
|
946
|
+
| `y` | `Int64` | The second operand |
|
|
947
947
|
|
|
948
948
|
Returns:
|
|
949
949
|
|
|
950
|
-
|type|description|
|
|
951
|
-
|
|
952
|
-
|
|
950
|
+
| type | description |
|
|
951
|
+
| ------- | ----------------------------------------------------------------------------------------------- |
|
|
952
|
+
| `Int64` | Containing a `1` in each bit position for which the corresponding bits of both operands are `1` |
|
|
953
953
|
|
|
954
954
|
Examples:
|
|
955
955
|
|
|
@@ -980,16 +980,16 @@ Computes the bitwise OR (`|`) on the given operands.
|
|
|
980
980
|
|
|
981
981
|
Parameters:
|
|
982
982
|
|
|
983
|
-
|param|type|description|
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
983
|
+
| param | type | description |
|
|
984
|
+
| ----- | ------- | ------------------ |
|
|
985
|
+
| `x` | `Int64` | The first operand |
|
|
986
|
+
| `y` | `Int64` | The second operand |
|
|
987
987
|
|
|
988
988
|
Returns:
|
|
989
989
|
|
|
990
|
-
|type|description|
|
|
991
|
-
|
|
992
|
-
|
|
990
|
+
| type | description |
|
|
991
|
+
| ------- | --------------------------------------------------------------------------------------------------------- |
|
|
992
|
+
| `Int64` | Containing a `1` in each bit position for which the corresponding bits of either or both operands are `1` |
|
|
993
993
|
|
|
994
994
|
Examples:
|
|
995
995
|
|
|
@@ -1020,16 +1020,16 @@ Computes the bitwise XOR (`^`) on the given operands.
|
|
|
1020
1020
|
|
|
1021
1021
|
Parameters:
|
|
1022
1022
|
|
|
1023
|
-
|param|type|description|
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1023
|
+
| param | type | description |
|
|
1024
|
+
| ----- | ------- | ------------------ |
|
|
1025
|
+
| `x` | `Int64` | The first operand |
|
|
1026
|
+
| `y` | `Int64` | The second operand |
|
|
1027
1027
|
|
|
1028
1028
|
Returns:
|
|
1029
1029
|
|
|
1030
|
-
|type|description|
|
|
1031
|
-
|
|
1032
|
-
|
|
1030
|
+
| type | description |
|
|
1031
|
+
| ------- | -------------------------------------------------------------------------------------------------------------- |
|
|
1032
|
+
| `Int64` | Containing a `1` in each bit position for which the corresponding bits of either but not both operands are `1` |
|
|
1033
1033
|
|
|
1034
1034
|
Examples:
|
|
1035
1035
|
|
|
@@ -1053,15 +1053,15 @@ Counts the number of leading zero bits in the value.
|
|
|
1053
1053
|
|
|
1054
1054
|
Parameters:
|
|
1055
1055
|
|
|
1056
|
-
|param|type|description|
|
|
1057
|
-
|
|
1058
|
-
|
|
1056
|
+
| param | type | description |
|
|
1057
|
+
| ------- | ------- | -------------------- |
|
|
1058
|
+
| `value` | `Int64` | The value to inspect |
|
|
1059
1059
|
|
|
1060
1060
|
Returns:
|
|
1061
1061
|
|
|
1062
|
-
|type|description|
|
|
1063
|
-
|
|
1064
|
-
|
|
1062
|
+
| type | description |
|
|
1063
|
+
| ------- | --------------------------- |
|
|
1064
|
+
| `Int64` | The amount of leading zeros |
|
|
1065
1065
|
|
|
1066
1066
|
Examples:
|
|
1067
1067
|
|
|
@@ -1088,15 +1088,15 @@ Counts the number of trailing zero bits in the value.
|
|
|
1088
1088
|
|
|
1089
1089
|
Parameters:
|
|
1090
1090
|
|
|
1091
|
-
|param|type|description|
|
|
1092
|
-
|
|
1093
|
-
|
|
1091
|
+
| param | type | description |
|
|
1092
|
+
| ------- | ------- | -------------------- |
|
|
1093
|
+
| `value` | `Int64` | The value to inspect |
|
|
1094
1094
|
|
|
1095
1095
|
Returns:
|
|
1096
1096
|
|
|
1097
|
-
|type|description|
|
|
1098
|
-
|
|
1099
|
-
|
|
1097
|
+
| type | description |
|
|
1098
|
+
| ------- | ---------------------------- |
|
|
1099
|
+
| `Int64` | The amount of trailing zeros |
|
|
1100
1100
|
|
|
1101
1101
|
Examples:
|
|
1102
1102
|
|
|
@@ -1123,15 +1123,15 @@ Counts the number of bits set to `1` in the value, also known as a population co
|
|
|
1123
1123
|
|
|
1124
1124
|
Parameters:
|
|
1125
1125
|
|
|
1126
|
-
|param|type|description|
|
|
1127
|
-
|
|
1128
|
-
|
|
1126
|
+
| param | type | description |
|
|
1127
|
+
| ------- | ------- | -------------------- |
|
|
1128
|
+
| `value` | `Int64` | The value to inspect |
|
|
1129
1129
|
|
|
1130
1130
|
Returns:
|
|
1131
1131
|
|
|
1132
|
-
|type|description|
|
|
1133
|
-
|
|
1134
|
-
|
|
1132
|
+
| type | description |
|
|
1133
|
+
| ------- | ----------------------------------- |
|
|
1134
|
+
| `Int64` | The amount of 1-bits in its operand |
|
|
1135
1135
|
|
|
1136
1136
|
Examples:
|
|
1137
1137
|
|
|
@@ -1158,21 +1158,21 @@ Computes the exponentiation of the given base and power.
|
|
|
1158
1158
|
|
|
1159
1159
|
Parameters:
|
|
1160
1160
|
|
|
1161
|
-
|param|type|description|
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1161
|
+
| param | type | description |
|
|
1162
|
+
| ------- | ------- | ------------------- |
|
|
1163
|
+
| `base` | `Int64` | The base number |
|
|
1164
|
+
| `power` | `Int64` | The exponent number |
|
|
1165
1165
|
|
|
1166
1166
|
Returns:
|
|
1167
1167
|
|
|
1168
|
-
|type|description|
|
|
1169
|
-
|
|
1170
|
-
|
|
1168
|
+
| type | description |
|
|
1169
|
+
| ------- | ---------------------------------- |
|
|
1170
|
+
| `Int64` | The base raised to the given power |
|
|
1171
1171
|
|
|
1172
1172
|
Examples:
|
|
1173
1173
|
|
|
1174
1174
|
```grain
|
|
1175
|
-
|
|
1175
|
+
use Int64.{ (**) }
|
|
1176
1176
|
assert 2L ** 3L == 8L
|
|
1177
1177
|
```
|
|
1178
1178
|
|