@grain/stdlib 0.5.13 → 0.6.1

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