@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/int16.md
CHANGED
|
@@ -33,22 +33,22 @@ No other changes yet.
|
|
|
33
33
|
</details>
|
|
34
34
|
|
|
35
35
|
```grain
|
|
36
|
-
fromNumber
|
|
36
|
+
fromNumber: (number: Number) => Int16
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
Converts a Number to an Int16.
|
|
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
|
+
| `Int16` | The Number represented as an Int16 |
|
|
52
52
|
|
|
53
53
|
### Int16.**toNumber**
|
|
54
54
|
|
|
@@ -58,22 +58,22 @@ No other changes yet.
|
|
|
58
58
|
</details>
|
|
59
59
|
|
|
60
60
|
```grain
|
|
61
|
-
toNumber
|
|
61
|
+
toNumber: (value: Int16) => Number
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
Converts an Int16 to a Number.
|
|
65
65
|
|
|
66
66
|
Parameters:
|
|
67
67
|
|
|
68
|
-
|param|type|description|
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
| param | type | description |
|
|
69
|
+
| ------- | ------- | -------------------- |
|
|
70
|
+
| `value` | `Int16` | The value to convert |
|
|
71
71
|
|
|
72
72
|
Returns:
|
|
73
73
|
|
|
74
|
-
|type|description|
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
| type | description |
|
|
75
|
+
| -------- | --------------------------------- |
|
|
76
|
+
| `Number` | The Int16 represented as a Number |
|
|
77
77
|
|
|
78
78
|
### Int16.**fromUint16**
|
|
79
79
|
|
|
@@ -83,22 +83,22 @@ No other changes yet.
|
|
|
83
83
|
</details>
|
|
84
84
|
|
|
85
85
|
```grain
|
|
86
|
-
fromUint16
|
|
86
|
+
fromUint16: (number: Uint16) => Int16
|
|
87
87
|
```
|
|
88
88
|
|
|
89
89
|
Converts a Uint16 to an Int16.
|
|
90
90
|
|
|
91
91
|
Parameters:
|
|
92
92
|
|
|
93
|
-
|param|type|description|
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
| param | type | description |
|
|
94
|
+
| -------- | -------- | -------------------- |
|
|
95
|
+
| `number` | `Uint16` | The value to convert |
|
|
96
96
|
|
|
97
97
|
Returns:
|
|
98
98
|
|
|
99
|
-
|type|description|
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
| type | description |
|
|
100
|
+
| ------- | ---------------------------------- |
|
|
101
|
+
| `Int16` | The Uint16 represented as an Int16 |
|
|
102
102
|
|
|
103
103
|
Examples:
|
|
104
104
|
|
|
@@ -114,22 +114,22 @@ No other changes yet.
|
|
|
114
114
|
</details>
|
|
115
115
|
|
|
116
116
|
```grain
|
|
117
|
-
incr
|
|
117
|
+
incr: (value: Int16) => Int16
|
|
118
118
|
```
|
|
119
119
|
|
|
120
120
|
Increments the value by one.
|
|
121
121
|
|
|
122
122
|
Parameters:
|
|
123
123
|
|
|
124
|
-
|param|type|description|
|
|
125
|
-
|
|
126
|
-
|
|
124
|
+
| param | type | description |
|
|
125
|
+
| ------- | ------- | ---------------------- |
|
|
126
|
+
| `value` | `Int16` | The value to increment |
|
|
127
127
|
|
|
128
128
|
Returns:
|
|
129
129
|
|
|
130
|
-
|type|description|
|
|
131
|
-
|
|
132
|
-
|
|
130
|
+
| type | description |
|
|
131
|
+
| ------- | --------------------- |
|
|
132
|
+
| `Int16` | The incremented value |
|
|
133
133
|
|
|
134
134
|
Examples:
|
|
135
135
|
|
|
@@ -149,22 +149,22 @@ No other changes yet.
|
|
|
149
149
|
</details>
|
|
150
150
|
|
|
151
151
|
```grain
|
|
152
|
-
decr
|
|
152
|
+
decr: (value: Int16) => Int16
|
|
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` | `Int16` | The value to decrement |
|
|
162
162
|
|
|
163
163
|
Returns:
|
|
164
164
|
|
|
165
|
-
|type|description|
|
|
166
|
-
|
|
167
|
-
|
|
165
|
+
| type | description |
|
|
166
|
+
| ------- | --------------------- |
|
|
167
|
+
| `Int16` | 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: Int16, y: Int16) => Int16
|
|
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` | `Int16` | The first operand |
|
|
197
|
+
| `y` | `Int16` | The second operand |
|
|
198
198
|
|
|
199
199
|
Returns:
|
|
200
200
|
|
|
201
|
-
|type|description|
|
|
202
|
-
|
|
203
|
-
|
|
201
|
+
| type | description |
|
|
202
|
+
| ------- | --------------------------- |
|
|
203
|
+
| `Int16` | 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: Int16, y: Int16) => Int16
|
|
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` | `Int16` | The first operand |
|
|
230
|
+
| `y` | `Int16` | The second operand |
|
|
231
231
|
|
|
232
232
|
Returns:
|
|
233
233
|
|
|
234
|
-
|type|description|
|
|
235
|
-
|
|
236
|
-
|
|
234
|
+
| type | description |
|
|
235
|
+
| ------- | ---------------------------------- |
|
|
236
|
+
| `Int16` | 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: Int16, y: Int16) => Int16
|
|
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` | `Int16` | The first operand |
|
|
263
|
+
| `y` | `Int16` | The second operand |
|
|
264
264
|
|
|
265
265
|
Returns:
|
|
266
266
|
|
|
267
|
-
|type|description|
|
|
268
|
-
|
|
269
|
-
|
|
267
|
+
| type | description |
|
|
268
|
+
| ------- | ------------------------------- |
|
|
269
|
+
| `Int16` | 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: Int16, y: Int16) => Int16
|
|
287
287
|
```
|
|
288
288
|
|
|
289
289
|
Computes the quotient of its operands using signed division.
|
|
290
290
|
|
|
291
291
|
Parameters:
|
|
292
292
|
|
|
293
|
-
|param|type|description|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
293
|
+
| param | type | description |
|
|
294
|
+
| ----- | ------- | ------------------ |
|
|
295
|
+
| `x` | `Int16` | The first operand |
|
|
296
|
+
| `y` | `Int16` | The second operand |
|
|
297
297
|
|
|
298
298
|
Returns:
|
|
299
299
|
|
|
300
|
-
|type|description|
|
|
301
|
-
|
|
302
|
-
|
|
300
|
+
| type | description |
|
|
301
|
+
| ------- | ---------------------------- |
|
|
302
|
+
| `Int16` | 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: Int16, y: Int16) => Int16
|
|
320
320
|
```
|
|
321
321
|
|
|
322
322
|
Computes the remainder of the division of its operands using signed division.
|
|
323
323
|
|
|
324
324
|
Parameters:
|
|
325
325
|
|
|
326
|
-
|param|type|description|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
326
|
+
| param | type | description |
|
|
327
|
+
| ----- | ------- | ------------------ |
|
|
328
|
+
| `x` | `Int16` | The first operand |
|
|
329
|
+
| `y` | `Int16` | The second operand |
|
|
330
330
|
|
|
331
331
|
Returns:
|
|
332
332
|
|
|
333
|
-
|type|description|
|
|
334
|
-
|
|
335
|
-
|
|
333
|
+
| type | description |
|
|
334
|
+
| ------- | ----------------------------- |
|
|
335
|
+
| `Int16` | The remainder of its operands |
|
|
336
336
|
|
|
337
337
|
Examples:
|
|
338
338
|
|
|
@@ -348,7 +348,7 @@ No other changes yet.
|
|
|
348
348
|
</details>
|
|
349
349
|
|
|
350
350
|
```grain
|
|
351
|
-
(%)
|
|
351
|
+
(%): (x: Int16, y: Int16) => Int16
|
|
352
352
|
```
|
|
353
353
|
|
|
354
354
|
Computes the remainder of the division of the first operand by the second.
|
|
@@ -356,16 +356,16 @@ The result will have the sign of the second operand.
|
|
|
356
356
|
|
|
357
357
|
Parameters:
|
|
358
358
|
|
|
359
|
-
|param|type|description|
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
359
|
+
| param | type | description |
|
|
360
|
+
| ----- | ------- | ------------------ |
|
|
361
|
+
| `x` | `Int16` | The first operand |
|
|
362
|
+
| `y` | `Int16` | The second operand |
|
|
363
363
|
|
|
364
364
|
Returns:
|
|
365
365
|
|
|
366
|
-
|type|description|
|
|
367
|
-
|
|
368
|
-
|
|
366
|
+
| type | description |
|
|
367
|
+
| ------- | --------------------------- |
|
|
368
|
+
| `Int16` | The modulus of its operands |
|
|
369
369
|
|
|
370
370
|
Throws:
|
|
371
371
|
|
|
@@ -388,23 +388,23 @@ No other changes yet.
|
|
|
388
388
|
</details>
|
|
389
389
|
|
|
390
390
|
```grain
|
|
391
|
-
(<<)
|
|
391
|
+
(<<): (value: Int16, amount: Int16) => Int16
|
|
392
392
|
```
|
|
393
393
|
|
|
394
394
|
Shifts the bits of the value left by the given number of bits.
|
|
395
395
|
|
|
396
396
|
Parameters:
|
|
397
397
|
|
|
398
|
-
|param|type|description|
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
398
|
+
| param | type | description |
|
|
399
|
+
| -------- | ------- | ------------------------------ |
|
|
400
|
+
| `value` | `Int16` | The value to shift |
|
|
401
|
+
| `amount` | `Int16` | The number of bits to shift by |
|
|
402
402
|
|
|
403
403
|
Returns:
|
|
404
404
|
|
|
405
|
-
|type|description|
|
|
406
|
-
|
|
407
|
-
|
|
405
|
+
| type | description |
|
|
406
|
+
| ------- | ----------------- |
|
|
407
|
+
| `Int16` | The shifted value |
|
|
408
408
|
|
|
409
409
|
Examples:
|
|
410
410
|
|
|
@@ -421,23 +421,23 @@ No other changes yet.
|
|
|
421
421
|
</details>
|
|
422
422
|
|
|
423
423
|
```grain
|
|
424
|
-
(>>)
|
|
424
|
+
(>>): (value: Int16, amount: Int16) => Int16
|
|
425
425
|
```
|
|
426
426
|
|
|
427
427
|
Shifts the bits of the value right by the given number of bits, preserving the sign bit.
|
|
428
428
|
|
|
429
429
|
Parameters:
|
|
430
430
|
|
|
431
|
-
|param|type|description|
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
431
|
+
| param | type | description |
|
|
432
|
+
| -------- | ------- | ---------------------- |
|
|
433
|
+
| `value` | `Int16` | The value to shift |
|
|
434
|
+
| `amount` | `Int16` | The amount to shift by |
|
|
435
435
|
|
|
436
436
|
Returns:
|
|
437
437
|
|
|
438
|
-
|type|description|
|
|
439
|
-
|
|
440
|
-
|
|
438
|
+
| type | description |
|
|
439
|
+
| ------- | ----------------- |
|
|
440
|
+
| `Int16` | The shifted value |
|
|
441
441
|
|
|
442
442
|
Examples:
|
|
443
443
|
|
|
@@ -454,23 +454,23 @@ No other changes yet.
|
|
|
454
454
|
</details>
|
|
455
455
|
|
|
456
456
|
```grain
|
|
457
|
-
(==)
|
|
457
|
+
(==): (x: Int16, y: Int16) => Bool
|
|
458
458
|
```
|
|
459
459
|
|
|
460
460
|
Checks if the first value is equal to the second value.
|
|
461
461
|
|
|
462
462
|
Parameters:
|
|
463
463
|
|
|
464
|
-
|param|type|description|
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
464
|
+
| param | type | description |
|
|
465
|
+
| ----- | ------- | ---------------- |
|
|
466
|
+
| `x` | `Int16` | The first value |
|
|
467
|
+
| `y` | `Int16` | The second value |
|
|
468
468
|
|
|
469
469
|
Returns:
|
|
470
470
|
|
|
471
|
-
|type|description|
|
|
472
|
-
|
|
473
|
-
|
|
471
|
+
| type | description |
|
|
472
|
+
| ------ | --------------------------------------------------------------------------- |
|
|
473
|
+
| `Bool` | `true` if the first value is equal to the second value or `false` otherwise |
|
|
474
474
|
|
|
475
475
|
Examples:
|
|
476
476
|
|
|
@@ -487,23 +487,23 @@ No other changes yet.
|
|
|
487
487
|
</details>
|
|
488
488
|
|
|
489
489
|
```grain
|
|
490
|
-
(!=)
|
|
490
|
+
(!=): (x: Int16, y: Int16) => Bool
|
|
491
491
|
```
|
|
492
492
|
|
|
493
493
|
Checks if the first value is not equal to the second value.
|
|
494
494
|
|
|
495
495
|
Parameters:
|
|
496
496
|
|
|
497
|
-
|param|type|description|
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
497
|
+
| param | type | description |
|
|
498
|
+
| ----- | ------- | ---------------- |
|
|
499
|
+
| `x` | `Int16` | The first value |
|
|
500
|
+
| `y` | `Int16` | The second value |
|
|
501
501
|
|
|
502
502
|
Returns:
|
|
503
503
|
|
|
504
|
-
|type|description|
|
|
505
|
-
|
|
506
|
-
|
|
504
|
+
| type | description |
|
|
505
|
+
| ------ | ------------------------------------------------------------------------------- |
|
|
506
|
+
| `Bool` | `true` if the first value is not equal to the second value or `false` otherwise |
|
|
507
507
|
|
|
508
508
|
Examples:
|
|
509
509
|
|
|
@@ -520,23 +520,23 @@ No other changes yet.
|
|
|
520
520
|
</details>
|
|
521
521
|
|
|
522
522
|
```grain
|
|
523
|
-
(<)
|
|
523
|
+
(<): (x: Int16, y: Int16) => Bool
|
|
524
524
|
```
|
|
525
525
|
|
|
526
526
|
Checks if the first value is less than the second value.
|
|
527
527
|
|
|
528
528
|
Parameters:
|
|
529
529
|
|
|
530
|
-
|param|type|description|
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
530
|
+
| param | type | description |
|
|
531
|
+
| ----- | ------- | ---------------- |
|
|
532
|
+
| `x` | `Int16` | The first value |
|
|
533
|
+
| `y` | `Int16` | The second value |
|
|
534
534
|
|
|
535
535
|
Returns:
|
|
536
536
|
|
|
537
|
-
|type|description|
|
|
538
|
-
|
|
539
|
-
|
|
537
|
+
| type | description |
|
|
538
|
+
| ------ | ---------------------------------------------------------------------------- |
|
|
539
|
+
| `Bool` | `true` if the first value is less than the second value or `false` otherwise |
|
|
540
540
|
|
|
541
541
|
Examples:
|
|
542
542
|
|
|
@@ -553,23 +553,23 @@ No other changes yet.
|
|
|
553
553
|
</details>
|
|
554
554
|
|
|
555
555
|
```grain
|
|
556
|
-
(>)
|
|
556
|
+
(>): (x: Int16, y: Int16) => Bool
|
|
557
557
|
```
|
|
558
558
|
|
|
559
559
|
Checks if the first value is greater than the second value.
|
|
560
560
|
|
|
561
561
|
Parameters:
|
|
562
562
|
|
|
563
|
-
|param|type|description|
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
563
|
+
| param | type | description |
|
|
564
|
+
| ----- | ------- | ---------------- |
|
|
565
|
+
| `x` | `Int16` | The first value |
|
|
566
|
+
| `y` | `Int16` | The second value |
|
|
567
567
|
|
|
568
568
|
Returns:
|
|
569
569
|
|
|
570
|
-
|type|description|
|
|
571
|
-
|
|
572
|
-
|
|
570
|
+
| type | description |
|
|
571
|
+
| ------ | ------------------------------------------------------------------------------- |
|
|
572
|
+
| `Bool` | `true` if the first value is greater than the second value or `false` otherwise |
|
|
573
573
|
|
|
574
574
|
Examples:
|
|
575
575
|
|
|
@@ -586,23 +586,23 @@ No other changes yet.
|
|
|
586
586
|
</details>
|
|
587
587
|
|
|
588
588
|
```grain
|
|
589
|
-
(<=)
|
|
589
|
+
(<=): (x: Int16, y: Int16) => Bool
|
|
590
590
|
```
|
|
591
591
|
|
|
592
592
|
Checks if the first value is less than or equal to the second value.
|
|
593
593
|
|
|
594
594
|
Parameters:
|
|
595
595
|
|
|
596
|
-
|param|type|description|
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
596
|
+
| param | type | description |
|
|
597
|
+
| ----- | ------- | ---------------- |
|
|
598
|
+
| `x` | `Int16` | The first value |
|
|
599
|
+
| `y` | `Int16` | The second value |
|
|
600
600
|
|
|
601
601
|
Returns:
|
|
602
602
|
|
|
603
|
-
|type|description|
|
|
604
|
-
|
|
605
|
-
|
|
603
|
+
| type | description |
|
|
604
|
+
| ------ | ---------------------------------------------------------------------------------------- |
|
|
605
|
+
| `Bool` | `true` if the first value is less than or equal to the second value or `false` otherwise |
|
|
606
606
|
|
|
607
607
|
Examples:
|
|
608
608
|
|
|
@@ -624,23 +624,23 @@ No other changes yet.
|
|
|
624
624
|
</details>
|
|
625
625
|
|
|
626
626
|
```grain
|
|
627
|
-
(>=)
|
|
627
|
+
(>=): (x: Int16, y: Int16) => Bool
|
|
628
628
|
```
|
|
629
629
|
|
|
630
630
|
Checks if the first value is greater than or equal to the second value.
|
|
631
631
|
|
|
632
632
|
Parameters:
|
|
633
633
|
|
|
634
|
-
|param|type|description|
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
634
|
+
| param | type | description |
|
|
635
|
+
| ----- | ------- | ---------------- |
|
|
636
|
+
| `x` | `Int16` | The first value |
|
|
637
|
+
| `y` | `Int16` | The second value |
|
|
638
638
|
|
|
639
639
|
Returns:
|
|
640
640
|
|
|
641
|
-
|type|description|
|
|
642
|
-
|
|
643
|
-
|
|
641
|
+
| type | description |
|
|
642
|
+
| ------ | ------------------------------------------------------------------------------------------- |
|
|
643
|
+
| `Bool` | `true` if the first value is greater than or equal to the second value or `false` otherwise |
|
|
644
644
|
|
|
645
645
|
Examples:
|
|
646
646
|
|
|
@@ -662,22 +662,22 @@ No other changes yet.
|
|
|
662
662
|
</details>
|
|
663
663
|
|
|
664
664
|
```grain
|
|
665
|
-
lnot
|
|
665
|
+
lnot: (value: Int16) => Int16
|
|
666
666
|
```
|
|
667
667
|
|
|
668
668
|
Computes the bitwise NOT of the given value.
|
|
669
669
|
|
|
670
670
|
Parameters:
|
|
671
671
|
|
|
672
|
-
|param|type|description|
|
|
673
|
-
|
|
674
|
-
|
|
672
|
+
| param | type | description |
|
|
673
|
+
| ------- | ------- | --------------- |
|
|
674
|
+
| `value` | `Int16` | The given value |
|
|
675
675
|
|
|
676
676
|
Returns:
|
|
677
677
|
|
|
678
|
-
|type|description|
|
|
679
|
-
|
|
680
|
-
|
|
678
|
+
| type | description |
|
|
679
|
+
| ------- | ----------------------------------------------- |
|
|
680
|
+
| `Int16` | Containing the inverted bits of the given value |
|
|
681
681
|
|
|
682
682
|
Examples:
|
|
683
683
|
|
|
@@ -693,23 +693,23 @@ No other changes yet.
|
|
|
693
693
|
</details>
|
|
694
694
|
|
|
695
695
|
```grain
|
|
696
|
-
(&)
|
|
696
|
+
(&): (x: Int16, y: Int16) => Int16
|
|
697
697
|
```
|
|
698
698
|
|
|
699
699
|
Computes the bitwise AND (`&`) on the given operands.
|
|
700
700
|
|
|
701
701
|
Parameters:
|
|
702
702
|
|
|
703
|
-
|param|type|description|
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
703
|
+
| param | type | description |
|
|
704
|
+
| ----- | ------- | ------------------ |
|
|
705
|
+
| `x` | `Int16` | The first operand |
|
|
706
|
+
| `y` | `Int16` | The second operand |
|
|
707
707
|
|
|
708
708
|
Returns:
|
|
709
709
|
|
|
710
|
-
|type|description|
|
|
711
|
-
|
|
712
|
-
|
|
710
|
+
| type | description |
|
|
711
|
+
| ------- | ----------------------------------------------------------------------------------------------- |
|
|
712
|
+
| `Int16` | Containing a `1` in each bit position for which the corresponding bits of both operands are `1` |
|
|
713
713
|
|
|
714
714
|
Examples:
|
|
715
715
|
|
|
@@ -726,23 +726,23 @@ No other changes yet.
|
|
|
726
726
|
</details>
|
|
727
727
|
|
|
728
728
|
```grain
|
|
729
|
-
(|)
|
|
729
|
+
(|): (x: Int16, y: Int16) => Int16
|
|
730
730
|
```
|
|
731
731
|
|
|
732
732
|
Computes the bitwise OR (`|`) on the given operands.
|
|
733
733
|
|
|
734
734
|
Parameters:
|
|
735
735
|
|
|
736
|
-
|param|type|description|
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
736
|
+
| param | type | description |
|
|
737
|
+
| ----- | ------- | ------------------ |
|
|
738
|
+
| `x` | `Int16` | The first operand |
|
|
739
|
+
| `y` | `Int16` | The second operand |
|
|
740
740
|
|
|
741
741
|
Returns:
|
|
742
742
|
|
|
743
|
-
|type|description|
|
|
744
|
-
|
|
745
|
-
|
|
743
|
+
| type | description |
|
|
744
|
+
| ------- | --------------------------------------------------------------------------------------------------------- |
|
|
745
|
+
| `Int16` | Containing a `1` in each bit position for which the corresponding bits of either or both operands are `1` |
|
|
746
746
|
|
|
747
747
|
Examples:
|
|
748
748
|
|
|
@@ -759,23 +759,23 @@ No other changes yet.
|
|
|
759
759
|
</details>
|
|
760
760
|
|
|
761
761
|
```grain
|
|
762
|
-
(^)
|
|
762
|
+
(^): (x: Int16, y: Int16) => Int16
|
|
763
763
|
```
|
|
764
764
|
|
|
765
765
|
Computes the bitwise XOR (`^`) on the given operands.
|
|
766
766
|
|
|
767
767
|
Parameters:
|
|
768
768
|
|
|
769
|
-
|param|type|description|
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
769
|
+
| param | type | description |
|
|
770
|
+
| ----- | ------- | ------------------ |
|
|
771
|
+
| `x` | `Int16` | The first operand |
|
|
772
|
+
| `y` | `Int16` | The second operand |
|
|
773
773
|
|
|
774
774
|
Returns:
|
|
775
775
|
|
|
776
|
-
|type|description|
|
|
777
|
-
|
|
778
|
-
|
|
776
|
+
| type | description |
|
|
777
|
+
| ------- | -------------------------------------------------------------------------------------------------------------- |
|
|
778
|
+
| `Int16` | Containing a `1` in each bit position for which the corresponding bits of either but not both operands are `1` |
|
|
779
779
|
|
|
780
780
|
Examples:
|
|
781
781
|
|