@grain/stdlib 0.4.2 → 0.4.6

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.
Files changed (61) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/LICENSE +1 -1
  3. package/array.gr +200 -89
  4. package/array.md +81 -5
  5. package/buffer.gr +93 -36
  6. package/bytes.gr +10 -10
  7. package/char.gr +112 -56
  8. package/char.md +200 -0
  9. package/float32.gr +120 -4
  10. package/float32.md +315 -0
  11. package/float64.gr +120 -4
  12. package/float64.md +315 -0
  13. package/hash.gr +42 -15
  14. package/hash.md +44 -0
  15. package/int32.gr +370 -75
  16. package/int32.md +833 -0
  17. package/int64.gr +370 -75
  18. package/int64.md +833 -0
  19. package/list.gr +121 -50
  20. package/map.gr +106 -110
  21. package/number.gr +37 -1
  22. package/number.md +66 -0
  23. package/option.gr +260 -53
  24. package/option.md +579 -0
  25. package/package.json +1 -1
  26. package/pervasives.gr +32 -20
  27. package/queue.gr +102 -30
  28. package/queue.md +191 -0
  29. package/range.gr +26 -26
  30. package/range.md +1 -1
  31. package/regex.md +9 -9
  32. package/result.gr +216 -70
  33. package/result.md +446 -0
  34. package/runtime/dataStructures.gr +28 -29
  35. package/runtime/debug.gr +0 -1
  36. package/runtime/equal.gr +37 -16
  37. package/runtime/exception.gr +28 -15
  38. package/runtime/gc.gr +33 -20
  39. package/runtime/malloc.gr +19 -11
  40. package/runtime/numberUtils.gr +208 -103
  41. package/runtime/numbers.gr +217 -118
  42. package/runtime/string.gr +98 -39
  43. package/runtime/stringUtils.gr +176 -0
  44. package/runtime/unsafe/conv.gr +10 -10
  45. package/runtime/unsafe/memory.gr +14 -3
  46. package/runtime/unsafe/printWasm.gr +4 -4
  47. package/runtime/unsafe/tags.gr +2 -2
  48. package/runtime/unsafe/wasmf32.gr +9 -2
  49. package/runtime/unsafe/wasmf64.gr +9 -2
  50. package/runtime/unsafe/wasmi32.gr +65 -47
  51. package/runtime/unsafe/wasmi64.gr +78 -50
  52. package/runtime/wasi.gr +199 -45
  53. package/set.gr +281 -119
  54. package/set.md +502 -0
  55. package/stack.gr +26 -26
  56. package/string.gr +657 -341
  57. package/string.md +815 -0
  58. package/sys/file.gr +356 -177
  59. package/sys/process.gr +10 -6
  60. package/sys/random.gr +3 -6
  61. package/sys/time.gr +3 -3
package/int64.md ADDED
@@ -0,0 +1,833 @@
1
+ ---
2
+ title: Int64
3
+ ---
4
+
5
+ Utilities for working with the Int64 type.
6
+
7
+ <details disabled>
8
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
9
+ No other changes yet.
10
+ </details>
11
+
12
+ ```grain
13
+ import Int64 from "int64"
14
+ ```
15
+
16
+ ## Conversions
17
+
18
+ Functions for converting between Numbers and the Int64 type.
19
+
20
+ ### Int64.**fromNumber**
21
+
22
+ <details disabled>
23
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
24
+ No other changes yet.
25
+ </details>
26
+
27
+ ```grain
28
+ fromNumber : Number -> Int64
29
+ ```
30
+
31
+ Converts a Number to an Int64.
32
+
33
+ Parameters:
34
+
35
+ |param|type|description|
36
+ |-----|----|-----------|
37
+ |`number`|`Number`|The value to convert|
38
+
39
+ Returns:
40
+
41
+ |type|description|
42
+ |----|-----------|
43
+ |`Int64`|The Number represented as an Int64|
44
+
45
+ ### Int64.**toNumber**
46
+
47
+ <details disabled>
48
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
49
+ No other changes yet.
50
+ </details>
51
+
52
+ ```grain
53
+ toNumber : Int64 -> Number
54
+ ```
55
+
56
+ Converts an Int64 to a Number.
57
+
58
+ Parameters:
59
+
60
+ |param|type|description|
61
+ |-----|----|-----------|
62
+ |`value`|`Int64`|The value to convert|
63
+
64
+ Returns:
65
+
66
+ |type|description|
67
+ |----|-----------|
68
+ |`Number`|The Int64 represented as a Number|
69
+
70
+ ## Operations
71
+
72
+ Mathematical operations for Int64 values.
73
+
74
+ ### Int64.**incr**
75
+
76
+ <details disabled>
77
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
78
+ No other changes yet.
79
+ </details>
80
+
81
+ ```grain
82
+ incr : Int64 -> Int64
83
+ ```
84
+
85
+ Increments the value by one.
86
+
87
+ Parameters:
88
+
89
+ |param|type|description|
90
+ |-----|----|-----------|
91
+ |`value`|`Int64`|The value to increment|
92
+
93
+ Returns:
94
+
95
+ |type|description|
96
+ |----|-----------|
97
+ |`Int64`|The incremented value|
98
+
99
+ ### Int64.**decr**
100
+
101
+ <details disabled>
102
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
103
+ No other changes yet.
104
+ </details>
105
+
106
+ ```grain
107
+ decr : Int64 -> Int64
108
+ ```
109
+
110
+ Decrements the value by one.
111
+
112
+ Parameters:
113
+
114
+ |param|type|description|
115
+ |-----|----|-----------|
116
+ |`value`|`Int64`|The value to decrement|
117
+
118
+ Returns:
119
+
120
+ |type|description|
121
+ |----|-----------|
122
+ |`Int64`|The decremented value|
123
+
124
+ ### Int64.**add**
125
+
126
+ <details disabled>
127
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
128
+ No other changes yet.
129
+ </details>
130
+
131
+ ```grain
132
+ add : (Int64, Int64) -> Int64
133
+ ```
134
+
135
+ Computes the sum of its operands.
136
+
137
+ Parameters:
138
+
139
+ |param|type|description|
140
+ |-----|----|-----------|
141
+ |`x`|`Int64`|The first operand|
142
+ |`y`|`Int64`|The second operand|
143
+
144
+ Returns:
145
+
146
+ |type|description|
147
+ |----|-----------|
148
+ |`Int64`|The sum of the two operands|
149
+
150
+ ### Int64.**sub**
151
+
152
+ <details disabled>
153
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
154
+ No other changes yet.
155
+ </details>
156
+
157
+ ```grain
158
+ sub : (Int64, Int64) -> Int64
159
+ ```
160
+
161
+ Computes the difference of its operands.
162
+
163
+ Parameters:
164
+
165
+ |param|type|description|
166
+ |-----|----|-----------|
167
+ |`x`|`Int64`|The first operand|
168
+ |`y`|`Int64`|The second operand|
169
+
170
+ Returns:
171
+
172
+ |type|description|
173
+ |----|-----------|
174
+ |`Int64`|The difference of the two operands|
175
+
176
+ ### Int64.**mul**
177
+
178
+ <details disabled>
179
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
180
+ No other changes yet.
181
+ </details>
182
+
183
+ ```grain
184
+ mul : (Int64, Int64) -> Int64
185
+ ```
186
+
187
+ Computes the product of its operands.
188
+
189
+ Parameters:
190
+
191
+ |param|type|description|
192
+ |-----|----|-----------|
193
+ |`x`|`Int64`|The first operand|
194
+ |`y`|`Int64`|The second operand|
195
+
196
+ Returns:
197
+
198
+ |type|description|
199
+ |----|-----------|
200
+ |`Int64`|The product of the two operands|
201
+
202
+ ### Int64.**div**
203
+
204
+ <details disabled>
205
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
206
+ No other changes yet.
207
+ </details>
208
+
209
+ ```grain
210
+ div : (Int64, Int64) -> Int64
211
+ ```
212
+
213
+ Computes the quotient of its operands using signed division.
214
+
215
+ Parameters:
216
+
217
+ |param|type|description|
218
+ |-----|----|-----------|
219
+ |`x`|`Int64`|The first operand|
220
+ |`y`|`Int64`|The second operand|
221
+
222
+ Returns:
223
+
224
+ |type|description|
225
+ |----|-----------|
226
+ |`Int64`|The quotient of its operands|
227
+
228
+ ### Int64.**divU**
229
+
230
+ <details disabled>
231
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
232
+ No other changes yet.
233
+ </details>
234
+
235
+ ```grain
236
+ divU : (Int64, Int64) -> Int64
237
+ ```
238
+
239
+ Computes the quotient of its operands using unsigned division.
240
+
241
+ Parameters:
242
+
243
+ |param|type|description|
244
+ |-----|----|-----------|
245
+ |`x`|`Int64`|The first operand|
246
+ |`y`|`Int64`|The second operand|
247
+
248
+ Returns:
249
+
250
+ |type|description|
251
+ |----|-----------|
252
+ |`Int64`|The quotient of its operands|
253
+
254
+ ### Int64.**rem**
255
+
256
+ <details disabled>
257
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
258
+ No other changes yet.
259
+ </details>
260
+
261
+ ```grain
262
+ rem : (Int64, Int64) -> Int64
263
+ ```
264
+
265
+ Computes the remainder of the division of its operands using signed division.
266
+
267
+ Parameters:
268
+
269
+ |param|type|description|
270
+ |-----|----|-----------|
271
+ |`x`|`Int64`|The first operand|
272
+ |`y`|`Int64`|The second operand|
273
+
274
+ Returns:
275
+
276
+ |type|description|
277
+ |----|-----------|
278
+ |`Int64`|The remainder of its operands|
279
+
280
+ ### Int64.**remU**
281
+
282
+ <details disabled>
283
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
284
+ No other changes yet.
285
+ </details>
286
+
287
+ ```grain
288
+ remU : (Int64, Int64) -> Int64
289
+ ```
290
+
291
+ Computes the remainder of the division of its operands using unsigned division.
292
+
293
+ Parameters:
294
+
295
+ |param|type|description|
296
+ |-----|----|-----------|
297
+ |`x`|`Int64`|The first operand|
298
+ |`y`|`Int64`|The second operand|
299
+
300
+ Returns:
301
+
302
+ |type|description|
303
+ |----|-----------|
304
+ |`Int64`|The remainder of its operands|
305
+
306
+ ### Int64.**mod**
307
+
308
+ <details disabled>
309
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
310
+ No other changes yet.
311
+ </details>
312
+
313
+ ```grain
314
+ mod : (Int64, Int64) -> Int64
315
+ ```
316
+
317
+ Computes the remainder of the division of the first operand by the second.
318
+ The result will have the sign of the second operand.
319
+
320
+ Parameters:
321
+
322
+ |param|type|description|
323
+ |-----|----|-----------|
324
+ |`x`|`Int64`|The first operand|
325
+ |`y`|`Int64`|The second operand|
326
+
327
+ Returns:
328
+
329
+ |type|description|
330
+ |----|-----------|
331
+ |`Int64`|The modulus of its operands|
332
+
333
+ ## Bitwise operations
334
+
335
+ Functions for operating on bits of Int64 values.
336
+
337
+ ### Int64.**rotl**
338
+
339
+ <details disabled>
340
+ <summary tabindex="-1">Added in <code>0.4.0</code></summary>
341
+ No other changes yet.
342
+ </details>
343
+
344
+ ```grain
345
+ rotl : (Int64, Int64) -> Int64
346
+ ```
347
+
348
+ Rotates the bits of the value left by the given number of bits.
349
+
350
+ Parameters:
351
+
352
+ |param|type|description|
353
+ |-----|----|-----------|
354
+ |`value`|`Int64`|The value to rotate|
355
+ |`amount`|`Int64`|The number of bits to rotate by|
356
+
357
+ Returns:
358
+
359
+ |type|description|
360
+ |----|-----------|
361
+ |`Int64`|The rotated value|
362
+
363
+ ### Int64.**rotr**
364
+
365
+ <details disabled>
366
+ <summary tabindex="-1">Added in <code>0.4.0</code></summary>
367
+ No other changes yet.
368
+ </details>
369
+
370
+ ```grain
371
+ rotr : (Int64, Int64) -> Int64
372
+ ```
373
+
374
+ Rotates the bits of the value right by the given number of bits.
375
+
376
+ Parameters:
377
+
378
+ |param|type|description|
379
+ |-----|----|-----------|
380
+ |`value`|`Int64`|The value to rotate|
381
+ |`amount`|`Int64`|The number of bits to rotate by|
382
+
383
+ Returns:
384
+
385
+ |type|description|
386
+ |----|-----------|
387
+ |`Int64`|The rotated value|
388
+
389
+ ### Int64.**shl**
390
+
391
+ <details disabled>
392
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
393
+ No other changes yet.
394
+ </details>
395
+
396
+ ```grain
397
+ shl : (Int64, Int64) -> Int64
398
+ ```
399
+
400
+ Shifts the bits of the value left by the given number of bits.
401
+
402
+ Parameters:
403
+
404
+ |param|type|description|
405
+ |-----|----|-----------|
406
+ |`value`|`Int64`|The value to shift|
407
+ |`amount`|`Int64`|The number of bits to shift by|
408
+
409
+ Returns:
410
+
411
+ |type|description|
412
+ |----|-----------|
413
+ |`Int64`|The shifted value|
414
+
415
+ ### Int64.**shr**
416
+
417
+ <details disabled>
418
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
419
+ No other changes yet.
420
+ </details>
421
+
422
+ ```grain
423
+ shr : (Int64, Int64) -> Int64
424
+ ```
425
+
426
+ Shifts the bits of the value right by the given number of bits, preserving the sign bit.
427
+
428
+ Parameters:
429
+
430
+ |param|type|description|
431
+ |-----|----|-----------|
432
+ |`value`|`Int64`|The value to shift|
433
+ |`amount`|`Int64`|The amount to shift by|
434
+
435
+ Returns:
436
+
437
+ |type|description|
438
+ |----|-----------|
439
+ |`Int64`|The shifted value|
440
+
441
+ ### Int64.**shrU**
442
+
443
+ <details disabled>
444
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
445
+ No other changes yet.
446
+ </details>
447
+
448
+ ```grain
449
+ shrU : (Int64, Int64) -> Int64
450
+ ```
451
+
452
+ Shifts the bits of the value right by the given number of bits.
453
+
454
+ Parameters:
455
+
456
+ |param|type|description|
457
+ |-----|----|-----------|
458
+ |`value`|`Int64`|The value to shift|
459
+ |`amount`|`Int64`|The amount to shift by|
460
+
461
+ Returns:
462
+
463
+ |type|description|
464
+ |----|-----------|
465
+ |`Int64`|The shifted value|
466
+
467
+ ## Comparisons
468
+
469
+ Functions for comparing Int64 values.
470
+
471
+ ### Int64.**eq**
472
+
473
+ <details disabled>
474
+ <summary tabindex="-1">Added in <code>0.4.0</code></summary>
475
+ No other changes yet.
476
+ </details>
477
+
478
+ ```grain
479
+ eq : (Int64, Int64) -> Bool
480
+ ```
481
+
482
+ Checks if the first value is equal to the second value.
483
+
484
+ Parameters:
485
+
486
+ |param|type|description|
487
+ |-----|----|-----------|
488
+ |`x`|`Int64`|The first value|
489
+ |`y`|`Int64`|The second value|
490
+
491
+ Returns:
492
+
493
+ |type|description|
494
+ |----|-----------|
495
+ |`Bool`|`true` if the first value is equal to the second value or `false` otherwise|
496
+
497
+ ### Int64.**ne**
498
+
499
+ <details disabled>
500
+ <summary tabindex="-1">Added in <code>0.4.0</code></summary>
501
+ No other changes yet.
502
+ </details>
503
+
504
+ ```grain
505
+ ne : (Int64, Int64) -> Bool
506
+ ```
507
+
508
+ Checks if the first value is not equal to the second value.
509
+
510
+ Parameters:
511
+
512
+ |param|type|description|
513
+ |-----|----|-----------|
514
+ |`x`|`Int64`|The first value|
515
+ |`y`|`Int64`|The second value|
516
+
517
+ Returns:
518
+
519
+ |type|description|
520
+ |----|-----------|
521
+ |`Bool`|`true` if the first value is not equal to the second value or `false` otherwise|
522
+
523
+ ### Int64.**eqz**
524
+
525
+ <details disabled>
526
+ <summary tabindex="-1">Added in <code>0.4.0</code></summary>
527
+ No other changes yet.
528
+ </details>
529
+
530
+ ```grain
531
+ eqz : Int64 -> Bool
532
+ ```
533
+
534
+ Checks if the given value is equal to zero.
535
+
536
+ Parameters:
537
+
538
+ |param|type|description|
539
+ |-----|----|-----------|
540
+ |`value`|`Int64`|The value to inspect|
541
+
542
+ Returns:
543
+
544
+ |type|description|
545
+ |----|-----------|
546
+ |`Bool`|`true` if the first value is equal to zero or `false` otherwise|
547
+
548
+ ### Int64.**lt**
549
+
550
+ <details disabled>
551
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
552
+ No other changes yet.
553
+ </details>
554
+
555
+ ```grain
556
+ lt : (Int64, Int64) -> Bool
557
+ ```
558
+
559
+ Checks if the first value is less than the second value.
560
+
561
+ Parameters:
562
+
563
+ |param|type|description|
564
+ |-----|----|-----------|
565
+ |`x`|`Int64`|The first value|
566
+ |`y`|`Int64`|The second value|
567
+
568
+ Returns:
569
+
570
+ |type|description|
571
+ |----|-----------|
572
+ |`Bool`|`true` if the first value is less than the second value or `false` otherwise|
573
+
574
+ ### Int64.**gt**
575
+
576
+ <details disabled>
577
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
578
+ No other changes yet.
579
+ </details>
580
+
581
+ ```grain
582
+ gt : (Int64, Int64) -> Bool
583
+ ```
584
+
585
+ Checks if the first value is greater than the second value.
586
+
587
+ Parameters:
588
+
589
+ |param|type|description|
590
+ |-----|----|-----------|
591
+ |`x`|`Int64`|The first value|
592
+ |`y`|`Int64`|The second value|
593
+
594
+ Returns:
595
+
596
+ |type|description|
597
+ |----|-----------|
598
+ |`Bool`|`true` if the first value is greater than the second value or `false` otherwise|
599
+
600
+ ### Int64.**lte**
601
+
602
+ <details disabled>
603
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
604
+ No other changes yet.
605
+ </details>
606
+
607
+ ```grain
608
+ lte : (Int64, Int64) -> Bool
609
+ ```
610
+
611
+ Checks if the first value is less than or equal to the second value.
612
+
613
+ Parameters:
614
+
615
+ |param|type|description|
616
+ |-----|----|-----------|
617
+ |`x`|`Int64`|The first value|
618
+ |`y`|`Int64`|The second value|
619
+
620
+ Returns:
621
+
622
+ |type|description|
623
+ |----|-----------|
624
+ |`Bool`|`true` if the first value is less than or equal to the second value or `false` otherwise|
625
+
626
+ ### Int64.**gte**
627
+
628
+ <details disabled>
629
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
630
+ No other changes yet.
631
+ </details>
632
+
633
+ ```grain
634
+ gte : (Int64, Int64) -> Bool
635
+ ```
636
+
637
+ Checks if the first value is greater than or equal to the second value.
638
+
639
+ Parameters:
640
+
641
+ |param|type|description|
642
+ |-----|----|-----------|
643
+ |`x`|`Int64`|The first value|
644
+ |`y`|`Int64`|The second value|
645
+
646
+ Returns:
647
+
648
+ |type|description|
649
+ |----|-----------|
650
+ |`Bool`|`true` if the first value is greater than or equal to the second value or `false` otherwise|
651
+
652
+ ## Bitwise logic
653
+
654
+ Boolean operations on the bits of Int64 values.
655
+
656
+ ### Int64.**lnot**
657
+
658
+ <details disabled>
659
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
660
+ No other changes yet.
661
+ </details>
662
+
663
+ ```grain
664
+ lnot : Int64 -> Int64
665
+ ```
666
+
667
+ Computes the bitwise NOT of the given value.
668
+
669
+ Parameters:
670
+
671
+ |param|type|description|
672
+ |-----|----|-----------|
673
+ |`value`|`Int64`|The given value|
674
+
675
+ Returns:
676
+
677
+ |type|description|
678
+ |----|-----------|
679
+ |`Int64`|Containing the inverted bits of the given value|
680
+
681
+ ### Int64.**land**
682
+
683
+ <details disabled>
684
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
685
+ No other changes yet.
686
+ </details>
687
+
688
+ ```grain
689
+ land : (Int64, Int64) -> Int64
690
+ ```
691
+
692
+ Computes the bitwise AND (`&`) on the given operands.
693
+
694
+ Parameters:
695
+
696
+ |param|type|description|
697
+ |-----|----|-----------|
698
+ |`x`|`Int64`|The first operand|
699
+ |`y`|`Int64`|The second operand|
700
+
701
+ Returns:
702
+
703
+ |type|description|
704
+ |----|-----------|
705
+ |`Int64`|Containing a `1` in each bit position for which the corresponding bits of both operands are `1`|
706
+
707
+ ### Int64.**lor**
708
+
709
+ <details disabled>
710
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
711
+ No other changes yet.
712
+ </details>
713
+
714
+ ```grain
715
+ lor : (Int64, Int64) -> Int64
716
+ ```
717
+
718
+ Computes the bitwise OR (`|`) on the given operands.
719
+
720
+ Parameters:
721
+
722
+ |param|type|description|
723
+ |-----|----|-----------|
724
+ |`x`|`Int64`|The first operand|
725
+ |`y`|`Int64`|The second operand|
726
+
727
+ Returns:
728
+
729
+ |type|description|
730
+ |----|-----------|
731
+ |`Int64`|Containing a `1` in each bit position for which the corresponding bits of either or both operands are `1`|
732
+
733
+ ### Int64.**lxor**
734
+
735
+ <details disabled>
736
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
737
+ No other changes yet.
738
+ </details>
739
+
740
+ ```grain
741
+ lxor : (Int64, Int64) -> Int64
742
+ ```
743
+
744
+ Computes the bitwise XOR (`^`) on the given operands.
745
+
746
+ Parameters:
747
+
748
+ |param|type|description|
749
+ |-----|----|-----------|
750
+ |`x`|`Int64`|The first operand|
751
+ |`y`|`Int64`|The second operand|
752
+
753
+ Returns:
754
+
755
+ |type|description|
756
+ |----|-----------|
757
+ |`Int64`|Containing a `1` in each bit position for which the corresponding bits of either but not both operands are `1`|
758
+
759
+ ### Int64.**clz**
760
+
761
+ <details disabled>
762
+ <summary tabindex="-1">Added in <code>0.4.0</code></summary>
763
+ No other changes yet.
764
+ </details>
765
+
766
+ ```grain
767
+ clz : Int64 -> Int64
768
+ ```
769
+
770
+ Counts the number of leading zero bits in the value.
771
+
772
+ Parameters:
773
+
774
+ |param|type|description|
775
+ |-----|----|-----------|
776
+ |`value`|`Int64`|The value to inspect|
777
+
778
+ Returns:
779
+
780
+ |type|description|
781
+ |----|-----------|
782
+ |`Int64`|The amount of leading zeros|
783
+
784
+ ### Int64.**ctz**
785
+
786
+ <details disabled>
787
+ <summary tabindex="-1">Added in <code>0.4.0</code></summary>
788
+ No other changes yet.
789
+ </details>
790
+
791
+ ```grain
792
+ ctz : Int64 -> Int64
793
+ ```
794
+
795
+ Counts the number of trailing zero bits in the value.
796
+
797
+ Parameters:
798
+
799
+ |param|type|description|
800
+ |-----|----|-----------|
801
+ |`value`|`Int64`|The value to inspect|
802
+
803
+ Returns:
804
+
805
+ |type|description|
806
+ |----|-----------|
807
+ |`Int64`|The amount of trailing zeros|
808
+
809
+ ### Int64.**popcnt**
810
+
811
+ <details disabled>
812
+ <summary tabindex="-1">Added in <code>0.4.0</code></summary>
813
+ No other changes yet.
814
+ </details>
815
+
816
+ ```grain
817
+ popcnt : Int64 -> Int64
818
+ ```
819
+
820
+ Counts the number of bits set to `1` in the value, also known as a population count.
821
+
822
+ Parameters:
823
+
824
+ |param|type|description|
825
+ |-----|----|-----------|
826
+ |`value`|`Int64`|The value to inspect|
827
+
828
+ Returns:
829
+
830
+ |type|description|
831
+ |----|-----------|
832
+ |`Int64`|The amount of 1-bits in its operand|
833
+