@grain/stdlib 0.5.12 → 0.6.0
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 +200 -0
- package/LICENSE +1 -1
- package/README.md +25 -2
- package/array.gr +1512 -199
- package/array.md +2032 -94
- package/bigint.gr +239 -140
- package/bigint.md +450 -106
- package/buffer.gr +595 -102
- package/buffer.md +903 -145
- package/bytes.gr +401 -110
- package/bytes.md +551 -63
- package/char.gr +228 -49
- package/char.md +373 -7
- package/exception.gr +26 -12
- package/exception.md +29 -5
- package/float32.gr +130 -109
- package/float32.md +185 -57
- package/float64.gr +112 -99
- package/float64.md +185 -57
- package/hash.gr +47 -37
- package/hash.md +21 -3
- package/int16.gr +430 -0
- package/int16.md +618 -0
- package/int32.gr +200 -269
- package/int32.md +254 -289
- package/int64.gr +142 -225
- package/int64.md +254 -289
- package/int8.gr +511 -0
- package/int8.md +786 -0
- package/json.gr +2084 -0
- package/json.md +608 -0
- package/list.gr +120 -68
- package/list.md +125 -80
- package/map.gr +560 -57
- package/map.md +672 -56
- package/marshal.gr +239 -227
- package/marshal.md +36 -4
- package/number.gr +626 -676
- package/number.md +738 -153
- package/option.gr +33 -35
- package/option.md +58 -42
- package/package.json +2 -2
- package/path.gr +148 -187
- package/path.md +47 -96
- package/pervasives.gr +75 -416
- package/pervasives.md +85 -180
- package/priorityqueue.gr +433 -74
- package/priorityqueue.md +422 -54
- package/queue.gr +362 -80
- package/queue.md +433 -38
- package/random.gr +67 -75
- package/random.md +68 -40
- package/range.gr +135 -63
- package/range.md +198 -43
- package/rational.gr +284 -0
- package/rational.md +545 -0
- package/regex.gr +933 -1066
- package/regex.md +59 -60
- package/result.gr +23 -25
- package/result.md +54 -39
- package/runtime/atof/common.gr +78 -82
- package/runtime/atof/common.md +22 -10
- package/runtime/atof/decimal.gr +102 -127
- package/runtime/atof/decimal.md +28 -7
- package/runtime/atof/lemire.gr +56 -71
- package/runtime/atof/lemire.md +9 -1
- package/runtime/atof/parse.gr +83 -110
- package/runtime/atof/parse.md +12 -2
- package/runtime/atof/slow.gr +28 -35
- package/runtime/atof/slow.md +9 -1
- package/runtime/atof/table.gr +19 -18
- package/runtime/atof/table.md +10 -2
- package/runtime/atoi/parse.gr +153 -136
- package/runtime/atoi/parse.md +50 -1
- package/runtime/bigint.gr +410 -517
- package/runtime/bigint.md +71 -57
- package/runtime/compare.gr +176 -85
- package/runtime/compare.md +31 -1
- package/runtime/dataStructures.gr +144 -32
- package/runtime/dataStructures.md +267 -31
- package/runtime/debugPrint.gr +34 -15
- package/runtime/debugPrint.md +37 -5
- package/runtime/equal.gr +53 -52
- package/runtime/equal.md +30 -1
- package/runtime/exception.gr +38 -47
- package/runtime/exception.md +10 -8
- package/runtime/gc.gr +23 -152
- package/runtime/gc.md +13 -17
- package/runtime/malloc.gr +31 -31
- package/runtime/malloc.md +11 -3
- package/runtime/numberUtils.gr +191 -172
- package/runtime/numberUtils.md +17 -9
- package/runtime/numbers.gr +1695 -1021
- package/runtime/numbers.md +1098 -134
- package/runtime/string.gr +540 -242
- package/runtime/string.md +76 -6
- package/runtime/unsafe/constants.gr +30 -13
- package/runtime/unsafe/constants.md +80 -0
- package/runtime/unsafe/conv.gr +55 -28
- package/runtime/unsafe/conv.md +41 -9
- package/runtime/unsafe/memory.gr +10 -30
- package/runtime/unsafe/memory.md +15 -19
- package/runtime/unsafe/tags.gr +37 -21
- package/runtime/unsafe/tags.md +88 -8
- package/runtime/unsafe/wasmf32.gr +30 -36
- package/runtime/unsafe/wasmf32.md +64 -56
- package/runtime/unsafe/wasmf64.gr +30 -36
- package/runtime/unsafe/wasmf64.md +64 -56
- package/runtime/unsafe/wasmi32.gr +49 -66
- package/runtime/unsafe/wasmi32.md +102 -94
- package/runtime/unsafe/wasmi64.gr +52 -79
- package/runtime/unsafe/wasmi64.md +108 -100
- package/runtime/utils/printing.gr +13 -15
- package/runtime/utils/printing.md +11 -3
- package/runtime/wasi.gr +294 -295
- package/runtime/wasi.md +62 -42
- package/set.gr +574 -64
- package/set.md +634 -54
- package/stack.gr +181 -64
- package/stack.md +271 -42
- package/string.gr +453 -533
- package/string.md +241 -151
- package/uint16.gr +369 -0
- package/uint16.md +585 -0
- package/uint32.gr +470 -0
- package/uint32.md +737 -0
- package/uint64.gr +471 -0
- package/uint64.md +737 -0
- package/uint8.gr +369 -0
- package/uint8.md +585 -0
- package/uri.gr +1093 -0
- package/uri.md +477 -0
- package/{sys → wasi}/file.gr +914 -500
- package/{sys → wasi}/file.md +454 -50
- package/wasi/process.gr +292 -0
- package/{sys → wasi}/process.md +164 -6
- package/wasi/random.gr +77 -0
- package/wasi/random.md +80 -0
- package/{sys → wasi}/time.gr +15 -22
- package/{sys → wasi}/time.md +5 -5
- package/immutablearray.gr +0 -929
- package/immutablearray.md +0 -1038
- package/immutablemap.gr +0 -493
- package/immutablemap.md +0 -479
- package/immutablepriorityqueue.gr +0 -360
- package/immutablepriorityqueue.md +0 -291
- package/immutableset.gr +0 -498
- package/immutableset.md +0 -449
- package/runtime/debug.gr +0 -2
- package/runtime/debug.md +0 -6
- package/runtime/unsafe/errors.gr +0 -36
- package/runtime/unsafe/errors.md +0 -204
- package/sys/process.gr +0 -254
- package/sys/random.gr +0 -79
- package/sys/random.md +0 -66
package/uint64.md
ADDED
|
@@ -0,0 +1,737 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Uint64
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Utilities for working with the Uint64 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 "uint64" include Uint64
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Values
|
|
17
|
+
|
|
18
|
+
Functions and constants included in the Uint64 module.
|
|
19
|
+
|
|
20
|
+
### Uint64.**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) => Uint64
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Converts a Number to a Uint64.
|
|
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
|
+
|`Uint64`|The Number represented as a Uint64|
|
|
44
|
+
|
|
45
|
+
### Uint64.**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: Uint64) => Number
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Converts a Uint64 to a Number.
|
|
57
|
+
|
|
58
|
+
Parameters:
|
|
59
|
+
|
|
60
|
+
|param|type|description|
|
|
61
|
+
|-----|----|-----------|
|
|
62
|
+
|`value`|`Uint64`|The value to convert|
|
|
63
|
+
|
|
64
|
+
Returns:
|
|
65
|
+
|
|
66
|
+
|type|description|
|
|
67
|
+
|----|-----------|
|
|
68
|
+
|`Number`|The Uint64 represented as a Number|
|
|
69
|
+
|
|
70
|
+
### Uint64.**fromInt64**
|
|
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
|
+
fromInt64 : (number: Int64) => Uint64
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Converts an Int64 to a Uint64.
|
|
82
|
+
|
|
83
|
+
Parameters:
|
|
84
|
+
|
|
85
|
+
|param|type|description|
|
|
86
|
+
|-----|----|-----------|
|
|
87
|
+
|`number`|`Int64`|The value to convert|
|
|
88
|
+
|
|
89
|
+
Returns:
|
|
90
|
+
|
|
91
|
+
|type|description|
|
|
92
|
+
|----|-----------|
|
|
93
|
+
|`Uint64`|The Int64 represented as a Uint64|
|
|
94
|
+
|
|
95
|
+
### Uint64.**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: Uint64) => Uint64
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Increments the value by one.
|
|
107
|
+
|
|
108
|
+
Parameters:
|
|
109
|
+
|
|
110
|
+
|param|type|description|
|
|
111
|
+
|-----|----|-----------|
|
|
112
|
+
|`value`|`Uint64`|The value to increment|
|
|
113
|
+
|
|
114
|
+
Returns:
|
|
115
|
+
|
|
116
|
+
|type|description|
|
|
117
|
+
|----|-----------|
|
|
118
|
+
|`Uint64`|The incremented value|
|
|
119
|
+
|
|
120
|
+
### Uint64.**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: Uint64) => Uint64
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Decrements the value by one.
|
|
132
|
+
|
|
133
|
+
Parameters:
|
|
134
|
+
|
|
135
|
+
|param|type|description|
|
|
136
|
+
|-----|----|-----------|
|
|
137
|
+
|`value`|`Uint64`|The value to decrement|
|
|
138
|
+
|
|
139
|
+
Returns:
|
|
140
|
+
|
|
141
|
+
|type|description|
|
|
142
|
+
|----|-----------|
|
|
143
|
+
|`Uint64`|The decremented value|
|
|
144
|
+
|
|
145
|
+
### Uint64.**(+)**
|
|
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: Uint64, y: Uint64) => Uint64
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Computes the sum of its operands.
|
|
157
|
+
|
|
158
|
+
Parameters:
|
|
159
|
+
|
|
160
|
+
|param|type|description|
|
|
161
|
+
|-----|----|-----------|
|
|
162
|
+
|`x`|`Uint64`|The first operand|
|
|
163
|
+
|`y`|`Uint64`|The second operand|
|
|
164
|
+
|
|
165
|
+
Returns:
|
|
166
|
+
|
|
167
|
+
|type|description|
|
|
168
|
+
|----|-----------|
|
|
169
|
+
|`Uint64`|The sum of the two operands|
|
|
170
|
+
|
|
171
|
+
### Uint64.**(-)**
|
|
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: Uint64, y: Uint64) => Uint64
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Computes the difference of its operands.
|
|
183
|
+
|
|
184
|
+
Parameters:
|
|
185
|
+
|
|
186
|
+
|param|type|description|
|
|
187
|
+
|-----|----|-----------|
|
|
188
|
+
|`x`|`Uint64`|The first operand|
|
|
189
|
+
|`y`|`Uint64`|The second operand|
|
|
190
|
+
|
|
191
|
+
Returns:
|
|
192
|
+
|
|
193
|
+
|type|description|
|
|
194
|
+
|----|-----------|
|
|
195
|
+
|`Uint64`|The difference of the two operands|
|
|
196
|
+
|
|
197
|
+
### Uint64.**(*)**
|
|
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: Uint64, y: Uint64) => Uint64
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Computes the product of its operands.
|
|
209
|
+
|
|
210
|
+
Parameters:
|
|
211
|
+
|
|
212
|
+
|param|type|description|
|
|
213
|
+
|-----|----|-----------|
|
|
214
|
+
|`x`|`Uint64`|The first operand|
|
|
215
|
+
|`y`|`Uint64`|The second operand|
|
|
216
|
+
|
|
217
|
+
Returns:
|
|
218
|
+
|
|
219
|
+
|type|description|
|
|
220
|
+
|----|-----------|
|
|
221
|
+
|`Uint64`|The product of the two operands|
|
|
222
|
+
|
|
223
|
+
### Uint64.**(/)**
|
|
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: Uint64, y: Uint64) => Uint64
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
Computes the quotient of its operands.
|
|
235
|
+
|
|
236
|
+
Parameters:
|
|
237
|
+
|
|
238
|
+
|param|type|description|
|
|
239
|
+
|-----|----|-----------|
|
|
240
|
+
|`x`|`Uint64`|The first operand|
|
|
241
|
+
|`y`|`Uint64`|The second operand|
|
|
242
|
+
|
|
243
|
+
Returns:
|
|
244
|
+
|
|
245
|
+
|type|description|
|
|
246
|
+
|----|-----------|
|
|
247
|
+
|`Uint64`|The quotient of its operands|
|
|
248
|
+
|
|
249
|
+
### Uint64.**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: Uint64, y: Uint64) => Uint64
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
Computes the remainder of the division of its operands.
|
|
261
|
+
|
|
262
|
+
Parameters:
|
|
263
|
+
|
|
264
|
+
|param|type|description|
|
|
265
|
+
|-----|----|-----------|
|
|
266
|
+
|`x`|`Uint64`|The first operand|
|
|
267
|
+
|`y`|`Uint64`|The second operand|
|
|
268
|
+
|
|
269
|
+
Returns:
|
|
270
|
+
|
|
271
|
+
|type|description|
|
|
272
|
+
|----|-----------|
|
|
273
|
+
|`Uint64`|The remainder of its operands|
|
|
274
|
+
|
|
275
|
+
### Uint64.**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: Uint64, amount: Uint64) => Uint64
|
|
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`|`Uint64`|The value to rotate|
|
|
293
|
+
|`amount`|`Uint64`|The number of bits to rotate by|
|
|
294
|
+
|
|
295
|
+
Returns:
|
|
296
|
+
|
|
297
|
+
|type|description|
|
|
298
|
+
|----|-----------|
|
|
299
|
+
|`Uint64`|The rotated value|
|
|
300
|
+
|
|
301
|
+
### Uint64.**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: Uint64, amount: Uint64) => Uint64
|
|
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`|`Uint64`|The value to rotate|
|
|
319
|
+
|`amount`|`Uint64`|The number of bits to rotate by|
|
|
320
|
+
|
|
321
|
+
Returns:
|
|
322
|
+
|
|
323
|
+
|type|description|
|
|
324
|
+
|----|-----------|
|
|
325
|
+
|`Uint64`|The rotated value|
|
|
326
|
+
|
|
327
|
+
### Uint64.**(<<)**
|
|
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: Uint64, amount: Uint64) => Uint64
|
|
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`|`Uint64`|The value to shift|
|
|
345
|
+
|`amount`|`Uint64`|The number of bits to shift by|
|
|
346
|
+
|
|
347
|
+
Returns:
|
|
348
|
+
|
|
349
|
+
|type|description|
|
|
350
|
+
|----|-----------|
|
|
351
|
+
|`Uint64`|The shifted value|
|
|
352
|
+
|
|
353
|
+
### Uint64.**(>>>)**
|
|
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: Uint64, amount: Uint64) => Uint64
|
|
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`|`Uint64`|The value to shift|
|
|
371
|
+
|`amount`|`Uint64`|The amount to shift by|
|
|
372
|
+
|
|
373
|
+
Returns:
|
|
374
|
+
|
|
375
|
+
|type|description|
|
|
376
|
+
|----|-----------|
|
|
377
|
+
|`Uint64`|The shifted value|
|
|
378
|
+
|
|
379
|
+
### Uint64.**(==)**
|
|
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: Uint64, y: Uint64) => 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`|`Uint64`|The first value|
|
|
397
|
+
|`y`|`Uint64`|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
|
+
### Uint64.**(!=)**
|
|
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: Uint64, y: Uint64) => 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`|`Uint64`|The first value|
|
|
423
|
+
|`y`|`Uint64`|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
|
+
### Uint64.**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: Uint64) => Bool
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
Checks if the given value is equal to zero.
|
|
443
|
+
|
|
444
|
+
Parameters:
|
|
445
|
+
|
|
446
|
+
|param|type|description|
|
|
447
|
+
|-----|----|-----------|
|
|
448
|
+
|`value`|`Uint64`|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
|
+
### Uint64.**(<)**
|
|
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: Uint64, y: Uint64) => 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`|`Uint64`|The first value|
|
|
474
|
+
|`y`|`Uint64`|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
|
+
### Uint64.**(>)**
|
|
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: Uint64, y: Uint64) => 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`|`Uint64`|The first value|
|
|
500
|
+
|`y`|`Uint64`|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
|
+
### Uint64.**(<=)**
|
|
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: Uint64, y: Uint64) => 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`|`Uint64`|The first value|
|
|
526
|
+
|`y`|`Uint64`|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
|
+
### Uint64.**(>=)**
|
|
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: Uint64, y: Uint64) => 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`|`Uint64`|The first value|
|
|
552
|
+
|`y`|`Uint64`|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
|
+
### Uint64.**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: Uint64) => Uint64
|
|
569
|
+
```
|
|
570
|
+
|
|
571
|
+
Computes the bitwise NOT of the given value.
|
|
572
|
+
|
|
573
|
+
Parameters:
|
|
574
|
+
|
|
575
|
+
|param|type|description|
|
|
576
|
+
|-----|----|-----------|
|
|
577
|
+
|`value`|`Uint64`|The given value|
|
|
578
|
+
|
|
579
|
+
Returns:
|
|
580
|
+
|
|
581
|
+
|type|description|
|
|
582
|
+
|----|-----------|
|
|
583
|
+
|`Uint64`|Containing the inverted bits of the given value|
|
|
584
|
+
|
|
585
|
+
### Uint64.**(&)**
|
|
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: Uint64, y: Uint64) => Uint64
|
|
594
|
+
```
|
|
595
|
+
|
|
596
|
+
Computes the bitwise AND (`&`) on the given operands.
|
|
597
|
+
|
|
598
|
+
Parameters:
|
|
599
|
+
|
|
600
|
+
|param|type|description|
|
|
601
|
+
|-----|----|-----------|
|
|
602
|
+
|`x`|`Uint64`|The first operand|
|
|
603
|
+
|`y`|`Uint64`|The second operand|
|
|
604
|
+
|
|
605
|
+
Returns:
|
|
606
|
+
|
|
607
|
+
|type|description|
|
|
608
|
+
|----|-----------|
|
|
609
|
+
|`Uint64`|Containing a `1` in each bit position for which the corresponding bits of both operands are `1`|
|
|
610
|
+
|
|
611
|
+
### Uint64.**(|)**
|
|
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: Uint64, y: Uint64) => Uint64
|
|
620
|
+
```
|
|
621
|
+
|
|
622
|
+
Computes the bitwise OR (`|`) on the given operands.
|
|
623
|
+
|
|
624
|
+
Parameters:
|
|
625
|
+
|
|
626
|
+
|param|type|description|
|
|
627
|
+
|-----|----|-----------|
|
|
628
|
+
|`x`|`Uint64`|The first operand|
|
|
629
|
+
|`y`|`Uint64`|The second operand|
|
|
630
|
+
|
|
631
|
+
Returns:
|
|
632
|
+
|
|
633
|
+
|type|description|
|
|
634
|
+
|----|-----------|
|
|
635
|
+
|`Uint64`|Containing a `1` in each bit position for which the corresponding bits of either or both operands are `1`|
|
|
636
|
+
|
|
637
|
+
### Uint64.**(^)**
|
|
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: Uint64, y: Uint64) => Uint64
|
|
646
|
+
```
|
|
647
|
+
|
|
648
|
+
Computes the bitwise XOR (`^`) on the given operands.
|
|
649
|
+
|
|
650
|
+
Parameters:
|
|
651
|
+
|
|
652
|
+
|param|type|description|
|
|
653
|
+
|-----|----|-----------|
|
|
654
|
+
|`x`|`Uint64`|The first operand|
|
|
655
|
+
|`y`|`Uint64`|The second operand|
|
|
656
|
+
|
|
657
|
+
Returns:
|
|
658
|
+
|
|
659
|
+
|type|description|
|
|
660
|
+
|----|-----------|
|
|
661
|
+
|`Uint64`|Containing a `1` in each bit position for which the corresponding bits of either but not both operands are `1`|
|
|
662
|
+
|
|
663
|
+
### Uint64.**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: Uint64) => Uint64
|
|
672
|
+
```
|
|
673
|
+
|
|
674
|
+
Counts the number of leading zero bits in the value.
|
|
675
|
+
|
|
676
|
+
Parameters:
|
|
677
|
+
|
|
678
|
+
|param|type|description|
|
|
679
|
+
|-----|----|-----------|
|
|
680
|
+
|`value`|`Uint64`|The value to inspect|
|
|
681
|
+
|
|
682
|
+
Returns:
|
|
683
|
+
|
|
684
|
+
|type|description|
|
|
685
|
+
|----|-----------|
|
|
686
|
+
|`Uint64`|The amount of leading zeros|
|
|
687
|
+
|
|
688
|
+
### Uint64.**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: Uint64) => Uint64
|
|
697
|
+
```
|
|
698
|
+
|
|
699
|
+
Counts the number of trailing zero bits in the value.
|
|
700
|
+
|
|
701
|
+
Parameters:
|
|
702
|
+
|
|
703
|
+
|param|type|description|
|
|
704
|
+
|-----|----|-----------|
|
|
705
|
+
|`value`|`Uint64`|The value to inspect|
|
|
706
|
+
|
|
707
|
+
Returns:
|
|
708
|
+
|
|
709
|
+
|type|description|
|
|
710
|
+
|----|-----------|
|
|
711
|
+
|`Uint64`|The amount of trailing zeros|
|
|
712
|
+
|
|
713
|
+
### Uint64.**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: Uint64) => Uint64
|
|
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`|`Uint64`|The value to inspect|
|
|
731
|
+
|
|
732
|
+
Returns:
|
|
733
|
+
|
|
734
|
+
|type|description|
|
|
735
|
+
|----|-----------|
|
|
736
|
+
|`Uint64`|The amount of 1-bits in its operand|
|
|
737
|
+
|