@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/uint8.md
CHANGED
|
@@ -33,22 +33,22 @@ No other changes yet.
|
|
|
33
33
|
</details>
|
|
34
34
|
|
|
35
35
|
```grain
|
|
36
|
-
fromNumber
|
|
36
|
+
fromNumber: (number: Number) => Uint8
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
Converts a Number to a Uint8.
|
|
40
40
|
|
|
41
41
|
Parameters:
|
|
42
42
|
|
|
43
|
-
|param|type|description|
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
| param | type | description |
|
|
44
|
+
| -------- | -------- | -------------------- |
|
|
45
|
+
| `number` | `Number` | The value to convert |
|
|
46
46
|
|
|
47
47
|
Returns:
|
|
48
48
|
|
|
49
|
-
|type|description|
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
| type | description |
|
|
50
|
+
| ------- | --------------------------------- |
|
|
51
|
+
| `Uint8` | The Number represented as a Uint8 |
|
|
52
52
|
|
|
53
53
|
### Uint8.**toNumber**
|
|
54
54
|
|
|
@@ -58,22 +58,22 @@ No other changes yet.
|
|
|
58
58
|
</details>
|
|
59
59
|
|
|
60
60
|
```grain
|
|
61
|
-
toNumber
|
|
61
|
+
toNumber: (value: Uint8) => Number
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
Converts a Uint8 to a Number.
|
|
65
65
|
|
|
66
66
|
Parameters:
|
|
67
67
|
|
|
68
|
-
|param|type|description|
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
| param | type | description |
|
|
69
|
+
| ------- | ------- | -------------------- |
|
|
70
|
+
| `value` | `Uint8` | The value to convert |
|
|
71
71
|
|
|
72
72
|
Returns:
|
|
73
73
|
|
|
74
|
-
|type|description|
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
| type | description |
|
|
75
|
+
| -------- | --------------------------------- |
|
|
76
|
+
| `Number` | The Uint8 represented as a Number |
|
|
77
77
|
|
|
78
78
|
### Uint8.**fromInt8**
|
|
79
79
|
|
|
@@ -83,22 +83,22 @@ No other changes yet.
|
|
|
83
83
|
</details>
|
|
84
84
|
|
|
85
85
|
```grain
|
|
86
|
-
fromInt8
|
|
86
|
+
fromInt8: (number: Int8) => Uint8
|
|
87
87
|
```
|
|
88
88
|
|
|
89
89
|
Converts an Int8 to a Uint8.
|
|
90
90
|
|
|
91
91
|
Parameters:
|
|
92
92
|
|
|
93
|
-
|param|type|description|
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
| param | type | description |
|
|
94
|
+
| -------- | ------ | -------------------- |
|
|
95
|
+
| `number` | `Int8` | The value to convert |
|
|
96
96
|
|
|
97
97
|
Returns:
|
|
98
98
|
|
|
99
|
-
|type|description|
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
| type | description |
|
|
100
|
+
| ------- | ------------------------------- |
|
|
101
|
+
| `Uint8` | The Int8 represented as a Uint8 |
|
|
102
102
|
|
|
103
103
|
Examples:
|
|
104
104
|
|
|
@@ -118,22 +118,22 @@ No other changes yet.
|
|
|
118
118
|
</details>
|
|
119
119
|
|
|
120
120
|
```grain
|
|
121
|
-
incr
|
|
121
|
+
incr: (value: Uint8) => Uint8
|
|
122
122
|
```
|
|
123
123
|
|
|
124
124
|
Increments the value by one.
|
|
125
125
|
|
|
126
126
|
Parameters:
|
|
127
127
|
|
|
128
|
-
|param|type|description|
|
|
129
|
-
|
|
130
|
-
|
|
128
|
+
| param | type | description |
|
|
129
|
+
| ------- | ------- | ---------------------- |
|
|
130
|
+
| `value` | `Uint8` | The value to increment |
|
|
131
131
|
|
|
132
132
|
Returns:
|
|
133
133
|
|
|
134
|
-
|type|description|
|
|
135
|
-
|
|
136
|
-
|
|
134
|
+
| type | description |
|
|
135
|
+
| ------- | --------------------- |
|
|
136
|
+
| `Uint8` | The incremented value |
|
|
137
137
|
|
|
138
138
|
Examples:
|
|
139
139
|
|
|
@@ -149,22 +149,22 @@ No other changes yet.
|
|
|
149
149
|
</details>
|
|
150
150
|
|
|
151
151
|
```grain
|
|
152
|
-
decr
|
|
152
|
+
decr: (value: Uint8) => Uint8
|
|
153
153
|
```
|
|
154
154
|
|
|
155
155
|
Decrements the value by one.
|
|
156
156
|
|
|
157
157
|
Parameters:
|
|
158
158
|
|
|
159
|
-
|param|type|description|
|
|
160
|
-
|
|
161
|
-
|
|
159
|
+
| param | type | description |
|
|
160
|
+
| ------- | ------- | ---------------------- |
|
|
161
|
+
| `value` | `Uint8` | The value to decrement |
|
|
162
162
|
|
|
163
163
|
Returns:
|
|
164
164
|
|
|
165
|
-
|type|description|
|
|
166
|
-
|
|
167
|
-
|
|
165
|
+
| type | description |
|
|
166
|
+
| ------- | --------------------- |
|
|
167
|
+
| `Uint8` | The decremented value |
|
|
168
168
|
|
|
169
169
|
Examples:
|
|
170
170
|
|
|
@@ -184,23 +184,23 @@ No other changes yet.
|
|
|
184
184
|
</details>
|
|
185
185
|
|
|
186
186
|
```grain
|
|
187
|
-
(+)
|
|
187
|
+
(+): (x: Uint8, y: Uint8) => Uint8
|
|
188
188
|
```
|
|
189
189
|
|
|
190
190
|
Computes the sum of its operands.
|
|
191
191
|
|
|
192
192
|
Parameters:
|
|
193
193
|
|
|
194
|
-
|param|type|description|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
194
|
+
| param | type | description |
|
|
195
|
+
| ----- | ------- | ------------------ |
|
|
196
|
+
| `x` | `Uint8` | The first operand |
|
|
197
|
+
| `y` | `Uint8` | The second operand |
|
|
198
198
|
|
|
199
199
|
Returns:
|
|
200
200
|
|
|
201
|
-
|type|description|
|
|
202
|
-
|
|
203
|
-
|
|
201
|
+
| type | description |
|
|
202
|
+
| ------- | --------------------------- |
|
|
203
|
+
| `Uint8` | The sum of the two operands |
|
|
204
204
|
|
|
205
205
|
Examples:
|
|
206
206
|
|
|
@@ -217,23 +217,23 @@ No other changes yet.
|
|
|
217
217
|
</details>
|
|
218
218
|
|
|
219
219
|
```grain
|
|
220
|
-
(-)
|
|
220
|
+
(-): (x: Uint8, y: Uint8) => Uint8
|
|
221
221
|
```
|
|
222
222
|
|
|
223
223
|
Computes the difference of its operands.
|
|
224
224
|
|
|
225
225
|
Parameters:
|
|
226
226
|
|
|
227
|
-
|param|type|description|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
227
|
+
| param | type | description |
|
|
228
|
+
| ----- | ------- | ------------------ |
|
|
229
|
+
| `x` | `Uint8` | The first operand |
|
|
230
|
+
| `y` | `Uint8` | The second operand |
|
|
231
231
|
|
|
232
232
|
Returns:
|
|
233
233
|
|
|
234
|
-
|type|description|
|
|
235
|
-
|
|
236
|
-
|
|
234
|
+
| type | description |
|
|
235
|
+
| ------- | ---------------------------------- |
|
|
236
|
+
| `Uint8` | The difference of the two operands |
|
|
237
237
|
|
|
238
238
|
Examples:
|
|
239
239
|
|
|
@@ -250,23 +250,23 @@ No other changes yet.
|
|
|
250
250
|
</details>
|
|
251
251
|
|
|
252
252
|
```grain
|
|
253
|
-
(*)
|
|
253
|
+
(*): (x: Uint8, y: Uint8) => Uint8
|
|
254
254
|
```
|
|
255
255
|
|
|
256
256
|
Computes the product of its operands.
|
|
257
257
|
|
|
258
258
|
Parameters:
|
|
259
259
|
|
|
260
|
-
|param|type|description|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
260
|
+
| param | type | description |
|
|
261
|
+
| ----- | ------- | ------------------ |
|
|
262
|
+
| `x` | `Uint8` | The first operand |
|
|
263
|
+
| `y` | `Uint8` | The second operand |
|
|
264
264
|
|
|
265
265
|
Returns:
|
|
266
266
|
|
|
267
|
-
|type|description|
|
|
268
|
-
|
|
269
|
-
|
|
267
|
+
| type | description |
|
|
268
|
+
| ------- | ------------------------------- |
|
|
269
|
+
| `Uint8` | The product of the two operands |
|
|
270
270
|
|
|
271
271
|
Examples:
|
|
272
272
|
|
|
@@ -283,23 +283,23 @@ No other changes yet.
|
|
|
283
283
|
</details>
|
|
284
284
|
|
|
285
285
|
```grain
|
|
286
|
-
(/)
|
|
286
|
+
(/): (x: Uint8, y: Uint8) => Uint8
|
|
287
287
|
```
|
|
288
288
|
|
|
289
289
|
Computes the quotient of its operands.
|
|
290
290
|
|
|
291
291
|
Parameters:
|
|
292
292
|
|
|
293
|
-
|param|type|description|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
293
|
+
| param | type | description |
|
|
294
|
+
| ----- | ------- | ------------------ |
|
|
295
|
+
| `x` | `Uint8` | The first operand |
|
|
296
|
+
| `y` | `Uint8` | The second operand |
|
|
297
297
|
|
|
298
298
|
Returns:
|
|
299
299
|
|
|
300
|
-
|type|description|
|
|
301
|
-
|
|
302
|
-
|
|
300
|
+
| type | description |
|
|
301
|
+
| ------- | ---------------------------- |
|
|
302
|
+
| `Uint8` | The quotient of its operands |
|
|
303
303
|
|
|
304
304
|
Examples:
|
|
305
305
|
|
|
@@ -316,23 +316,23 @@ No other changes yet.
|
|
|
316
316
|
</details>
|
|
317
317
|
|
|
318
318
|
```grain
|
|
319
|
-
rem
|
|
319
|
+
rem: (x: Uint8, y: Uint8) => Uint8
|
|
320
320
|
```
|
|
321
321
|
|
|
322
322
|
Computes the remainder of the division of its operands.
|
|
323
323
|
|
|
324
324
|
Parameters:
|
|
325
325
|
|
|
326
|
-
|param|type|description|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
326
|
+
| param | type | description |
|
|
327
|
+
| ----- | ------- | ------------------ |
|
|
328
|
+
| `x` | `Uint8` | The first operand |
|
|
329
|
+
| `y` | `Uint8` | The second operand |
|
|
330
330
|
|
|
331
331
|
Returns:
|
|
332
332
|
|
|
333
|
-
|type|description|
|
|
334
|
-
|
|
335
|
-
|
|
333
|
+
| type | description |
|
|
334
|
+
| ------- | ----------------------------- |
|
|
335
|
+
| `Uint8` | The remainder of its operands |
|
|
336
336
|
|
|
337
337
|
Examples:
|
|
338
338
|
|
|
@@ -348,23 +348,23 @@ No other changes yet.
|
|
|
348
348
|
</details>
|
|
349
349
|
|
|
350
350
|
```grain
|
|
351
|
-
(<<)
|
|
351
|
+
(<<): (value: Uint8, amount: Uint8) => Uint8
|
|
352
352
|
```
|
|
353
353
|
|
|
354
354
|
Shifts the bits of the value left by the given number of bits.
|
|
355
355
|
|
|
356
356
|
Parameters:
|
|
357
357
|
|
|
358
|
-
|param|type|description|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
358
|
+
| param | type | description |
|
|
359
|
+
| -------- | ------- | ------------------------------ |
|
|
360
|
+
| `value` | `Uint8` | The value to shift |
|
|
361
|
+
| `amount` | `Uint8` | The number of bits to shift by |
|
|
362
362
|
|
|
363
363
|
Returns:
|
|
364
364
|
|
|
365
|
-
|type|description|
|
|
366
|
-
|
|
367
|
-
|
|
365
|
+
| type | description |
|
|
366
|
+
| ------- | ----------------- |
|
|
367
|
+
| `Uint8` | The shifted value |
|
|
368
368
|
|
|
369
369
|
Examples:
|
|
370
370
|
|
|
@@ -381,23 +381,23 @@ No other changes yet.
|
|
|
381
381
|
</details>
|
|
382
382
|
|
|
383
383
|
```grain
|
|
384
|
-
(>>>)
|
|
384
|
+
(>>>): (value: Uint8, amount: Uint8) => Uint8
|
|
385
385
|
```
|
|
386
386
|
|
|
387
387
|
Shifts the bits of the value right by the given number of bits.
|
|
388
388
|
|
|
389
389
|
Parameters:
|
|
390
390
|
|
|
391
|
-
|param|type|description|
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
391
|
+
| param | type | description |
|
|
392
|
+
| -------- | ------- | ---------------------- |
|
|
393
|
+
| `value` | `Uint8` | The value to shift |
|
|
394
|
+
| `amount` | `Uint8` | The amount to shift by |
|
|
395
395
|
|
|
396
396
|
Returns:
|
|
397
397
|
|
|
398
|
-
|type|description|
|
|
399
|
-
|
|
400
|
-
|
|
398
|
+
| type | description |
|
|
399
|
+
| ------- | ----------------- |
|
|
400
|
+
| `Uint8` | The shifted value |
|
|
401
401
|
|
|
402
402
|
Examples:
|
|
403
403
|
|
|
@@ -414,23 +414,23 @@ No other changes yet.
|
|
|
414
414
|
</details>
|
|
415
415
|
|
|
416
416
|
```grain
|
|
417
|
-
(==)
|
|
417
|
+
(==): (x: Uint8, y: Uint8) => Bool
|
|
418
418
|
```
|
|
419
419
|
|
|
420
420
|
Checks if the first value is equal to the second value.
|
|
421
421
|
|
|
422
422
|
Parameters:
|
|
423
423
|
|
|
424
|
-
|param|type|description|
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
424
|
+
| param | type | description |
|
|
425
|
+
| ----- | ------- | ---------------- |
|
|
426
|
+
| `x` | `Uint8` | The first value |
|
|
427
|
+
| `y` | `Uint8` | The second value |
|
|
428
428
|
|
|
429
429
|
Returns:
|
|
430
430
|
|
|
431
|
-
|type|description|
|
|
432
|
-
|
|
433
|
-
|
|
431
|
+
| type | description |
|
|
432
|
+
| ------ | --------------------------------------------------------------------------- |
|
|
433
|
+
| `Bool` | `true` if the first value is equal to the second value or `false` otherwise |
|
|
434
434
|
|
|
435
435
|
Examples:
|
|
436
436
|
|
|
@@ -447,23 +447,23 @@ No other changes yet.
|
|
|
447
447
|
</details>
|
|
448
448
|
|
|
449
449
|
```grain
|
|
450
|
-
(!=)
|
|
450
|
+
(!=): (x: Uint8, y: Uint8) => Bool
|
|
451
451
|
```
|
|
452
452
|
|
|
453
453
|
Checks if the first value is not equal to the second value.
|
|
454
454
|
|
|
455
455
|
Parameters:
|
|
456
456
|
|
|
457
|
-
|param|type|description|
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
457
|
+
| param | type | description |
|
|
458
|
+
| ----- | ------- | ---------------- |
|
|
459
|
+
| `x` | `Uint8` | The first value |
|
|
460
|
+
| `y` | `Uint8` | The second value |
|
|
461
461
|
|
|
462
462
|
Returns:
|
|
463
463
|
|
|
464
|
-
|type|description|
|
|
465
|
-
|
|
466
|
-
|
|
464
|
+
| type | description |
|
|
465
|
+
| ------ | ------------------------------------------------------------------------------- |
|
|
466
|
+
| `Bool` | `true` if the first value is not equal to the second value or `false` otherwise |
|
|
467
467
|
|
|
468
468
|
Examples:
|
|
469
469
|
|
|
@@ -480,23 +480,23 @@ No other changes yet.
|
|
|
480
480
|
</details>
|
|
481
481
|
|
|
482
482
|
```grain
|
|
483
|
-
(<)
|
|
483
|
+
(<): (x: Uint8, y: Uint8) => Bool
|
|
484
484
|
```
|
|
485
485
|
|
|
486
486
|
Checks if the first value is less than the second value.
|
|
487
487
|
|
|
488
488
|
Parameters:
|
|
489
489
|
|
|
490
|
-
|param|type|description|
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
490
|
+
| param | type | description |
|
|
491
|
+
| ----- | ------- | ---------------- |
|
|
492
|
+
| `x` | `Uint8` | The first value |
|
|
493
|
+
| `y` | `Uint8` | The second value |
|
|
494
494
|
|
|
495
495
|
Returns:
|
|
496
496
|
|
|
497
|
-
|type|description|
|
|
498
|
-
|
|
499
|
-
|
|
497
|
+
| type | description |
|
|
498
|
+
| ------ | ---------------------------------------------------------------------------- |
|
|
499
|
+
| `Bool` | `true` if the first value is less than the second value or `false` otherwise |
|
|
500
500
|
|
|
501
501
|
Examples:
|
|
502
502
|
|
|
@@ -513,23 +513,23 @@ No other changes yet.
|
|
|
513
513
|
</details>
|
|
514
514
|
|
|
515
515
|
```grain
|
|
516
|
-
(>)
|
|
516
|
+
(>): (x: Uint8, y: Uint8) => Bool
|
|
517
517
|
```
|
|
518
518
|
|
|
519
519
|
Checks if the first value is greater than the second value.
|
|
520
520
|
|
|
521
521
|
Parameters:
|
|
522
522
|
|
|
523
|
-
|param|type|description|
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
523
|
+
| param | type | description |
|
|
524
|
+
| ----- | ------- | ---------------- |
|
|
525
|
+
| `x` | `Uint8` | The first value |
|
|
526
|
+
| `y` | `Uint8` | The second value |
|
|
527
527
|
|
|
528
528
|
Returns:
|
|
529
529
|
|
|
530
|
-
|type|description|
|
|
531
|
-
|
|
532
|
-
|
|
530
|
+
| type | description |
|
|
531
|
+
| ------ | ------------------------------------------------------------------------------- |
|
|
532
|
+
| `Bool` | `true` if the first value is greater than the second value or `false` otherwise |
|
|
533
533
|
|
|
534
534
|
Examples:
|
|
535
535
|
|
|
@@ -546,23 +546,23 @@ No other changes yet.
|
|
|
546
546
|
</details>
|
|
547
547
|
|
|
548
548
|
```grain
|
|
549
|
-
(<=)
|
|
549
|
+
(<=): (x: Uint8, y: Uint8) => Bool
|
|
550
550
|
```
|
|
551
551
|
|
|
552
552
|
Checks if the first value is less than or equal to the second value.
|
|
553
553
|
|
|
554
554
|
Parameters:
|
|
555
555
|
|
|
556
|
-
|param|type|description|
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
556
|
+
| param | type | description |
|
|
557
|
+
| ----- | ------- | ---------------- |
|
|
558
|
+
| `x` | `Uint8` | The first value |
|
|
559
|
+
| `y` | `Uint8` | The second value |
|
|
560
560
|
|
|
561
561
|
Returns:
|
|
562
562
|
|
|
563
|
-
|type|description|
|
|
564
|
-
|
|
565
|
-
|
|
563
|
+
| type | description |
|
|
564
|
+
| ------ | ---------------------------------------------------------------------------------------- |
|
|
565
|
+
| `Bool` | `true` if the first value is less than or equal to the second value or `false` otherwise |
|
|
566
566
|
|
|
567
567
|
Examples:
|
|
568
568
|
|
|
@@ -584,23 +584,23 @@ No other changes yet.
|
|
|
584
584
|
</details>
|
|
585
585
|
|
|
586
586
|
```grain
|
|
587
|
-
(>=)
|
|
587
|
+
(>=): (x: Uint8, y: Uint8) => Bool
|
|
588
588
|
```
|
|
589
589
|
|
|
590
590
|
Checks if the first value is greater than or equal to the second value.
|
|
591
591
|
|
|
592
592
|
Parameters:
|
|
593
593
|
|
|
594
|
-
|param|type|description|
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
594
|
+
| param | type | description |
|
|
595
|
+
| ----- | ------- | ---------------- |
|
|
596
|
+
| `x` | `Uint8` | The first value |
|
|
597
|
+
| `y` | `Uint8` | The second value |
|
|
598
598
|
|
|
599
599
|
Returns:
|
|
600
600
|
|
|
601
|
-
|type|description|
|
|
602
|
-
|
|
603
|
-
|
|
601
|
+
| type | description |
|
|
602
|
+
| ------ | ------------------------------------------------------------------------------------------- |
|
|
603
|
+
| `Bool` | `true` if the first value is greater than or equal to the second value or `false` otherwise |
|
|
604
604
|
|
|
605
605
|
Examples:
|
|
606
606
|
|
|
@@ -622,22 +622,22 @@ No other changes yet.
|
|
|
622
622
|
</details>
|
|
623
623
|
|
|
624
624
|
```grain
|
|
625
|
-
lnot
|
|
625
|
+
lnot: (value: Uint8) => Uint8
|
|
626
626
|
```
|
|
627
627
|
|
|
628
628
|
Computes the bitwise NOT of the given value.
|
|
629
629
|
|
|
630
630
|
Parameters:
|
|
631
631
|
|
|
632
|
-
|param|type|description|
|
|
633
|
-
|
|
634
|
-
|
|
632
|
+
| param | type | description |
|
|
633
|
+
| ------- | ------- | --------------- |
|
|
634
|
+
| `value` | `Uint8` | The given value |
|
|
635
635
|
|
|
636
636
|
Returns:
|
|
637
637
|
|
|
638
|
-
|type|description|
|
|
639
|
-
|
|
640
|
-
|
|
638
|
+
| type | description |
|
|
639
|
+
| ------- | ----------------------------------------------- |
|
|
640
|
+
| `Uint8` | Containing the inverted bits of the given value |
|
|
641
641
|
|
|
642
642
|
Examples:
|
|
643
643
|
|
|
@@ -653,23 +653,23 @@ No other changes yet.
|
|
|
653
653
|
</details>
|
|
654
654
|
|
|
655
655
|
```grain
|
|
656
|
-
(&)
|
|
656
|
+
(&): (x: Uint8, y: Uint8) => Uint8
|
|
657
657
|
```
|
|
658
658
|
|
|
659
659
|
Computes the bitwise AND (`&`) on the given operands.
|
|
660
660
|
|
|
661
661
|
Parameters:
|
|
662
662
|
|
|
663
|
-
|param|type|description|
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
663
|
+
| param | type | description |
|
|
664
|
+
| ----- | ------- | ------------------ |
|
|
665
|
+
| `x` | `Uint8` | The first operand |
|
|
666
|
+
| `y` | `Uint8` | The second operand |
|
|
667
667
|
|
|
668
668
|
Returns:
|
|
669
669
|
|
|
670
|
-
|type|description|
|
|
671
|
-
|
|
672
|
-
|
|
670
|
+
| type | description |
|
|
671
|
+
| ------- | ----------------------------------------------------------------------------------------------- |
|
|
672
|
+
| `Uint8` | Containing a `1` in each bit position for which the corresponding bits of both operands are `1` |
|
|
673
673
|
|
|
674
674
|
Examples:
|
|
675
675
|
|
|
@@ -686,23 +686,23 @@ No other changes yet.
|
|
|
686
686
|
</details>
|
|
687
687
|
|
|
688
688
|
```grain
|
|
689
|
-
(|)
|
|
689
|
+
(|): (x: Uint8, y: Uint8) => Uint8
|
|
690
690
|
```
|
|
691
691
|
|
|
692
692
|
Computes the bitwise OR (`|`) on the given operands.
|
|
693
693
|
|
|
694
694
|
Parameters:
|
|
695
695
|
|
|
696
|
-
|param|type|description|
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
696
|
+
| param | type | description |
|
|
697
|
+
| ----- | ------- | ------------------ |
|
|
698
|
+
| `x` | `Uint8` | The first operand |
|
|
699
|
+
| `y` | `Uint8` | The second operand |
|
|
700
700
|
|
|
701
701
|
Returns:
|
|
702
702
|
|
|
703
|
-
|type|description|
|
|
704
|
-
|
|
705
|
-
|
|
703
|
+
| type | description |
|
|
704
|
+
| ------- | --------------------------------------------------------------------------------------------------------- |
|
|
705
|
+
| `Uint8` | Containing a `1` in each bit position for which the corresponding bits of either or both operands are `1` |
|
|
706
706
|
|
|
707
707
|
Examples:
|
|
708
708
|
|
|
@@ -719,23 +719,23 @@ No other changes yet.
|
|
|
719
719
|
</details>
|
|
720
720
|
|
|
721
721
|
```grain
|
|
722
|
-
(^)
|
|
722
|
+
(^): (x: Uint8, y: Uint8) => Uint8
|
|
723
723
|
```
|
|
724
724
|
|
|
725
725
|
Computes the bitwise XOR (`^`) on the given operands.
|
|
726
726
|
|
|
727
727
|
Parameters:
|
|
728
728
|
|
|
729
|
-
|param|type|description|
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
729
|
+
| param | type | description |
|
|
730
|
+
| ----- | ------- | ------------------ |
|
|
731
|
+
| `x` | `Uint8` | The first operand |
|
|
732
|
+
| `y` | `Uint8` | The second operand |
|
|
733
733
|
|
|
734
734
|
Returns:
|
|
735
735
|
|
|
736
|
-
|type|description|
|
|
737
|
-
|
|
738
|
-
|
|
736
|
+
| type | description |
|
|
737
|
+
| ------- | -------------------------------------------------------------------------------------------------------------- |
|
|
738
|
+
| `Uint8` | Containing a `1` in each bit position for which the corresponding bits of either but not both operands are `1` |
|
|
739
739
|
|
|
740
740
|
Examples:
|
|
741
741
|
|