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