@grain/stdlib 0.5.13 → 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 +193 -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/int64.md
CHANGED
|
@@ -10,12 +10,12 @@ No other changes yet.
|
|
|
10
10
|
</details>
|
|
11
11
|
|
|
12
12
|
```grain
|
|
13
|
-
|
|
13
|
+
from "int64" include Int64
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
##
|
|
16
|
+
## Values
|
|
17
17
|
|
|
18
|
-
Functions
|
|
18
|
+
Functions and constants included in the Int64 module.
|
|
19
19
|
|
|
20
20
|
### Int64.**fromNumber**
|
|
21
21
|
|
|
@@ -25,7 +25,7 @@ No other changes yet.
|
|
|
25
25
|
</details>
|
|
26
26
|
|
|
27
27
|
```grain
|
|
28
|
-
fromNumber : Number
|
|
28
|
+
fromNumber : (number: Number) => Int64
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
Converts a Number to an Int64.
|
|
@@ -50,7 +50,7 @@ No other changes yet.
|
|
|
50
50
|
</details>
|
|
51
51
|
|
|
52
52
|
```grain
|
|
53
|
-
toNumber : Int64
|
|
53
|
+
toNumber : (value: Int64) => Number
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
Converts an Int64 to a Number.
|
|
@@ -67,36 +67,32 @@ Returns:
|
|
|
67
67
|
|----|-----------|
|
|
68
68
|
|`Number`|The Int64 represented as a Number|
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
Mathematical operations for Int64 values.
|
|
73
|
-
|
|
74
|
-
### Int64.**incr**
|
|
70
|
+
### Int64.**fromUint64**
|
|
75
71
|
|
|
76
72
|
<details disabled>
|
|
77
|
-
<summary tabindex="-1">Added in <code>0.
|
|
73
|
+
<summary tabindex="-1">Added in <code>0.6.0</code></summary>
|
|
78
74
|
No other changes yet.
|
|
79
75
|
</details>
|
|
80
76
|
|
|
81
77
|
```grain
|
|
82
|
-
|
|
78
|
+
fromUint64 : (number: Uint64) => Int64
|
|
83
79
|
```
|
|
84
80
|
|
|
85
|
-
|
|
81
|
+
Converts a Uint64 to an Int64.
|
|
86
82
|
|
|
87
83
|
Parameters:
|
|
88
84
|
|
|
89
85
|
|param|type|description|
|
|
90
86
|
|-----|----|-----------|
|
|
91
|
-
|`
|
|
87
|
+
|`number`|`Uint64`|The value to convert|
|
|
92
88
|
|
|
93
89
|
Returns:
|
|
94
90
|
|
|
95
91
|
|type|description|
|
|
96
92
|
|----|-----------|
|
|
97
|
-
|`Int64`|The
|
|
93
|
+
|`Int64`|The Uint64 represented as an Int64|
|
|
98
94
|
|
|
99
|
-
### Int64.**
|
|
95
|
+
### Int64.**incr**
|
|
100
96
|
|
|
101
97
|
<details disabled>
|
|
102
98
|
<summary tabindex="-1">Added in <code>0.2.0</code></summary>
|
|
@@ -104,24 +100,24 @@ No other changes yet.
|
|
|
104
100
|
</details>
|
|
105
101
|
|
|
106
102
|
```grain
|
|
107
|
-
|
|
103
|
+
incr : (value: Int64) => Int64
|
|
108
104
|
```
|
|
109
105
|
|
|
110
|
-
|
|
106
|
+
Increments the value by one.
|
|
111
107
|
|
|
112
108
|
Parameters:
|
|
113
109
|
|
|
114
110
|
|param|type|description|
|
|
115
111
|
|-----|----|-----------|
|
|
116
|
-
|`value`|`Int64`|The value to
|
|
112
|
+
|`value`|`Int64`|The value to increment|
|
|
117
113
|
|
|
118
114
|
Returns:
|
|
119
115
|
|
|
120
116
|
|type|description|
|
|
121
117
|
|----|-----------|
|
|
122
|
-
|`Int64`|The
|
|
118
|
+
|`Int64`|The incremented value|
|
|
123
119
|
|
|
124
|
-
### Int64.**
|
|
120
|
+
### Int64.**decr**
|
|
125
121
|
|
|
126
122
|
<details disabled>
|
|
127
123
|
<summary tabindex="-1">Added in <code>0.2.0</code></summary>
|
|
@@ -129,36 +125,42 @@ No other changes yet.
|
|
|
129
125
|
</details>
|
|
130
126
|
|
|
131
127
|
```grain
|
|
132
|
-
|
|
128
|
+
decr : (value: Int64) => Int64
|
|
133
129
|
```
|
|
134
130
|
|
|
135
|
-
|
|
131
|
+
Decrements the value by one.
|
|
136
132
|
|
|
137
133
|
Parameters:
|
|
138
134
|
|
|
139
135
|
|param|type|description|
|
|
140
136
|
|-----|----|-----------|
|
|
141
|
-
|`
|
|
142
|
-
|`y`|`Int64`|The second operand|
|
|
137
|
+
|`value`|`Int64`|The value to decrement|
|
|
143
138
|
|
|
144
139
|
Returns:
|
|
145
140
|
|
|
146
141
|
|type|description|
|
|
147
142
|
|----|-----------|
|
|
148
|
-
|`Int64`|The
|
|
143
|
+
|`Int64`|The decremented value|
|
|
149
144
|
|
|
150
|
-
### Int64.**
|
|
145
|
+
### Int64.**(+)**
|
|
151
146
|
|
|
152
|
-
<details
|
|
153
|
-
<summary
|
|
154
|
-
|
|
147
|
+
<details>
|
|
148
|
+
<summary>Added in <code>0.6.0</code></summary>
|
|
149
|
+
<table>
|
|
150
|
+
<thead>
|
|
151
|
+
<tr><th>version</th><th>changes</th></tr>
|
|
152
|
+
</thead>
|
|
153
|
+
<tbody>
|
|
154
|
+
<tr><td><code>0.2.0</code></td><td>Originally named `add`</td></tr>
|
|
155
|
+
</tbody>
|
|
156
|
+
</table>
|
|
155
157
|
</details>
|
|
156
158
|
|
|
157
159
|
```grain
|
|
158
|
-
|
|
160
|
+
(+) : (x: Int64, y: Int64) => Int64
|
|
159
161
|
```
|
|
160
162
|
|
|
161
|
-
Computes the
|
|
163
|
+
Computes the sum of its operands.
|
|
162
164
|
|
|
163
165
|
Parameters:
|
|
164
166
|
|
|
@@ -171,20 +173,27 @@ Returns:
|
|
|
171
173
|
|
|
172
174
|
|type|description|
|
|
173
175
|
|----|-----------|
|
|
174
|
-
|`Int64`|The
|
|
176
|
+
|`Int64`|The sum of the two operands|
|
|
175
177
|
|
|
176
|
-
### Int64.**
|
|
178
|
+
### Int64.**(-)**
|
|
177
179
|
|
|
178
|
-
<details
|
|
179
|
-
<summary
|
|
180
|
-
|
|
180
|
+
<details>
|
|
181
|
+
<summary>Added in <code>0.6.0</code></summary>
|
|
182
|
+
<table>
|
|
183
|
+
<thead>
|
|
184
|
+
<tr><th>version</th><th>changes</th></tr>
|
|
185
|
+
</thead>
|
|
186
|
+
<tbody>
|
|
187
|
+
<tr><td><code>0.2.0</code></td><td>Originally named `sub`</td></tr>
|
|
188
|
+
</tbody>
|
|
189
|
+
</table>
|
|
181
190
|
</details>
|
|
182
191
|
|
|
183
192
|
```grain
|
|
184
|
-
|
|
193
|
+
(-) : (x: Int64, y: Int64) => Int64
|
|
185
194
|
```
|
|
186
195
|
|
|
187
|
-
Computes the
|
|
196
|
+
Computes the difference of its operands.
|
|
188
197
|
|
|
189
198
|
Parameters:
|
|
190
199
|
|
|
@@ -197,20 +206,27 @@ Returns:
|
|
|
197
206
|
|
|
198
207
|
|type|description|
|
|
199
208
|
|----|-----------|
|
|
200
|
-
|`Int64`|The
|
|
209
|
+
|`Int64`|The difference of the two operands|
|
|
201
210
|
|
|
202
|
-
### Int64.**
|
|
211
|
+
### Int64.**(*)**
|
|
203
212
|
|
|
204
|
-
<details
|
|
205
|
-
<summary
|
|
206
|
-
|
|
213
|
+
<details>
|
|
214
|
+
<summary>Added in <code>0.6.0</code></summary>
|
|
215
|
+
<table>
|
|
216
|
+
<thead>
|
|
217
|
+
<tr><th>version</th><th>changes</th></tr>
|
|
218
|
+
</thead>
|
|
219
|
+
<tbody>
|
|
220
|
+
<tr><td><code>0.2.0</code></td><td>Originally named `*`</td></tr>
|
|
221
|
+
</tbody>
|
|
222
|
+
</table>
|
|
207
223
|
</details>
|
|
208
224
|
|
|
209
225
|
```grain
|
|
210
|
-
|
|
226
|
+
(*) : (x: Int64, y: Int64) => Int64
|
|
211
227
|
```
|
|
212
228
|
|
|
213
|
-
Computes the
|
|
229
|
+
Computes the product of its operands.
|
|
214
230
|
|
|
215
231
|
Parameters:
|
|
216
232
|
|
|
@@ -223,20 +239,27 @@ Returns:
|
|
|
223
239
|
|
|
224
240
|
|type|description|
|
|
225
241
|
|----|-----------|
|
|
226
|
-
|`Int64`|The
|
|
242
|
+
|`Int64`|The product of the two operands|
|
|
227
243
|
|
|
228
|
-
### Int64.**
|
|
244
|
+
### Int64.**(/)**
|
|
229
245
|
|
|
230
|
-
<details
|
|
231
|
-
<summary
|
|
232
|
-
|
|
246
|
+
<details>
|
|
247
|
+
<summary>Added in <code>0.6.0</code></summary>
|
|
248
|
+
<table>
|
|
249
|
+
<thead>
|
|
250
|
+
<tr><th>version</th><th>changes</th></tr>
|
|
251
|
+
</thead>
|
|
252
|
+
<tbody>
|
|
253
|
+
<tr><td><code>0.2.0</code></td><td>Originally named `div`</td></tr>
|
|
254
|
+
</tbody>
|
|
255
|
+
</table>
|
|
233
256
|
</details>
|
|
234
257
|
|
|
235
258
|
```grain
|
|
236
|
-
|
|
259
|
+
(/) : (x: Int64, y: Int64) => Int64
|
|
237
260
|
```
|
|
238
261
|
|
|
239
|
-
Computes the quotient of its operands using
|
|
262
|
+
Computes the quotient of its operands using signed division.
|
|
240
263
|
|
|
241
264
|
Parameters:
|
|
242
265
|
|
|
@@ -259,7 +282,7 @@ No other changes yet.
|
|
|
259
282
|
</details>
|
|
260
283
|
|
|
261
284
|
```grain
|
|
262
|
-
rem : (Int64, Int64)
|
|
285
|
+
rem : (x: Int64, y: Int64) => Int64
|
|
263
286
|
```
|
|
264
287
|
|
|
265
288
|
Computes the remainder of the division of its operands using signed division.
|
|
@@ -277,41 +300,22 @@ Returns:
|
|
|
277
300
|
|----|-----------|
|
|
278
301
|
|`Int64`|The remainder of its operands|
|
|
279
302
|
|
|
280
|
-
### Int64.**
|
|
281
|
-
|
|
282
|
-
<details disabled>
|
|
283
|
-
<summary tabindex="-1">Added in <code>0.2.0</code></summary>
|
|
284
|
-
No other changes yet.
|
|
285
|
-
</details>
|
|
286
|
-
|
|
287
|
-
```grain
|
|
288
|
-
remU : (Int64, Int64) -> Int64
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
Computes the remainder of the division of its operands using unsigned division.
|
|
292
|
-
|
|
293
|
-
Parameters:
|
|
294
|
-
|
|
295
|
-
|param|type|description|
|
|
296
|
-
|-----|----|-----------|
|
|
297
|
-
|`x`|`Int64`|The first operand|
|
|
298
|
-
|`y`|`Int64`|The second operand|
|
|
299
|
-
|
|
300
|
-
Returns:
|
|
301
|
-
|
|
302
|
-
|type|description|
|
|
303
|
-
|----|-----------|
|
|
304
|
-
|`Int64`|The remainder of its operands|
|
|
305
|
-
|
|
306
|
-
### Int64.**mod**
|
|
303
|
+
### Int64.**(%)**
|
|
307
304
|
|
|
308
|
-
<details
|
|
309
|
-
<summary
|
|
310
|
-
|
|
305
|
+
<details>
|
|
306
|
+
<summary>Added in <code>0.6.0</code></summary>
|
|
307
|
+
<table>
|
|
308
|
+
<thead>
|
|
309
|
+
<tr><th>version</th><th>changes</th></tr>
|
|
310
|
+
</thead>
|
|
311
|
+
<tbody>
|
|
312
|
+
<tr><td><code>0.2.0</code></td><td>Originally named `mod`</td></tr>
|
|
313
|
+
</tbody>
|
|
314
|
+
</table>
|
|
311
315
|
</details>
|
|
312
316
|
|
|
313
317
|
```grain
|
|
314
|
-
|
|
318
|
+
(%) : (x: Int64, y: Int64) => Int64
|
|
315
319
|
```
|
|
316
320
|
|
|
317
321
|
Computes the remainder of the division of the first operand by the second.
|
|
@@ -336,10 +340,6 @@ Throws:
|
|
|
336
340
|
|
|
337
341
|
* When `y` is zero
|
|
338
342
|
|
|
339
|
-
## Bitwise operations
|
|
340
|
-
|
|
341
|
-
Functions for operating on bits of Int64 values.
|
|
342
|
-
|
|
343
343
|
### Int64.**rotl**
|
|
344
344
|
|
|
345
345
|
<details disabled>
|
|
@@ -348,7 +348,7 @@ No other changes yet.
|
|
|
348
348
|
</details>
|
|
349
349
|
|
|
350
350
|
```grain
|
|
351
|
-
rotl : (Int64, Int64)
|
|
351
|
+
rotl : (value: Int64, amount: Int64) => Int64
|
|
352
352
|
```
|
|
353
353
|
|
|
354
354
|
Rotates the bits of the value left by the given number of bits.
|
|
@@ -374,7 +374,7 @@ No other changes yet.
|
|
|
374
374
|
</details>
|
|
375
375
|
|
|
376
376
|
```grain
|
|
377
|
-
rotr : (Int64, Int64)
|
|
377
|
+
rotr : (value: Int64, amount: Int64) => Int64
|
|
378
378
|
```
|
|
379
379
|
|
|
380
380
|
Rotates the bits of the value right by the given number of bits.
|
|
@@ -392,15 +392,22 @@ Returns:
|
|
|
392
392
|
|----|-----------|
|
|
393
393
|
|`Int64`|The rotated value|
|
|
394
394
|
|
|
395
|
-
### Int64.**
|
|
395
|
+
### Int64.**(<<)**
|
|
396
396
|
|
|
397
|
-
<details
|
|
398
|
-
<summary
|
|
399
|
-
|
|
397
|
+
<details>
|
|
398
|
+
<summary>Added in <code>0.6.0</code></summary>
|
|
399
|
+
<table>
|
|
400
|
+
<thead>
|
|
401
|
+
<tr><th>version</th><th>changes</th></tr>
|
|
402
|
+
</thead>
|
|
403
|
+
<tbody>
|
|
404
|
+
<tr><td><code>0.2.0</code></td><td>Originally named `shl`</td></tr>
|
|
405
|
+
</tbody>
|
|
406
|
+
</table>
|
|
400
407
|
</details>
|
|
401
408
|
|
|
402
409
|
```grain
|
|
403
|
-
|
|
410
|
+
(<<) : (value: Int64, amount: Int64) => Int64
|
|
404
411
|
```
|
|
405
412
|
|
|
406
413
|
Shifts the bits of the value left by the given number of bits.
|
|
@@ -418,15 +425,22 @@ Returns:
|
|
|
418
425
|
|----|-----------|
|
|
419
426
|
|`Int64`|The shifted value|
|
|
420
427
|
|
|
421
|
-
### Int64.**
|
|
428
|
+
### Int64.**(>>)**
|
|
422
429
|
|
|
423
|
-
<details
|
|
424
|
-
<summary
|
|
425
|
-
|
|
430
|
+
<details>
|
|
431
|
+
<summary>Added in <code>0.6.0</code></summary>
|
|
432
|
+
<table>
|
|
433
|
+
<thead>
|
|
434
|
+
<tr><th>version</th><th>changes</th></tr>
|
|
435
|
+
</thead>
|
|
436
|
+
<tbody>
|
|
437
|
+
<tr><td><code>0.2.0</code></td><td>Originally named `shr`</td></tr>
|
|
438
|
+
</tbody>
|
|
439
|
+
</table>
|
|
426
440
|
</details>
|
|
427
441
|
|
|
428
442
|
```grain
|
|
429
|
-
|
|
443
|
+
(>>) : (value: Int64, amount: Int64) => Int64
|
|
430
444
|
```
|
|
431
445
|
|
|
432
446
|
Shifts the bits of the value right by the given number of bits, preserving the sign bit.
|
|
@@ -444,45 +458,22 @@ Returns:
|
|
|
444
458
|
|----|-----------|
|
|
445
459
|
|`Int64`|The shifted value|
|
|
446
460
|
|
|
447
|
-
### Int64.**
|
|
461
|
+
### Int64.**(==)**
|
|
448
462
|
|
|
449
|
-
<details
|
|
450
|
-
<summary
|
|
451
|
-
|
|
463
|
+
<details>
|
|
464
|
+
<summary>Added in <code>0.6.0</code></summary>
|
|
465
|
+
<table>
|
|
466
|
+
<thead>
|
|
467
|
+
<tr><th>version</th><th>changes</th></tr>
|
|
468
|
+
</thead>
|
|
469
|
+
<tbody>
|
|
470
|
+
<tr><td><code>0.4.0</code></td><td>Originally named `eq`</td></tr>
|
|
471
|
+
</tbody>
|
|
472
|
+
</table>
|
|
452
473
|
</details>
|
|
453
474
|
|
|
454
475
|
```grain
|
|
455
|
-
|
|
456
|
-
```
|
|
457
|
-
|
|
458
|
-
Shifts the bits of the value right by the given number of bits.
|
|
459
|
-
|
|
460
|
-
Parameters:
|
|
461
|
-
|
|
462
|
-
|param|type|description|
|
|
463
|
-
|-----|----|-----------|
|
|
464
|
-
|`value`|`Int64`|The value to shift|
|
|
465
|
-
|`amount`|`Int64`|The amount to shift by|
|
|
466
|
-
|
|
467
|
-
Returns:
|
|
468
|
-
|
|
469
|
-
|type|description|
|
|
470
|
-
|----|-----------|
|
|
471
|
-
|`Int64`|The shifted value|
|
|
472
|
-
|
|
473
|
-
## Comparisons
|
|
474
|
-
|
|
475
|
-
Functions for comparing Int64 values.
|
|
476
|
-
|
|
477
|
-
### Int64.**eq**
|
|
478
|
-
|
|
479
|
-
<details disabled>
|
|
480
|
-
<summary tabindex="-1">Added in <code>0.4.0</code></summary>
|
|
481
|
-
No other changes yet.
|
|
482
|
-
</details>
|
|
483
|
-
|
|
484
|
-
```grain
|
|
485
|
-
eq : (Int64, Int64) -> Bool
|
|
476
|
+
(==) : (x: Int64, y: Int64) => Bool
|
|
486
477
|
```
|
|
487
478
|
|
|
488
479
|
Checks if the first value is equal to the second value.
|
|
@@ -500,15 +491,22 @@ Returns:
|
|
|
500
491
|
|----|-----------|
|
|
501
492
|
|`Bool`|`true` if the first value is equal to the second value or `false` otherwise|
|
|
502
493
|
|
|
503
|
-
### Int64.**
|
|
494
|
+
### Int64.**(!=)**
|
|
504
495
|
|
|
505
|
-
<details
|
|
506
|
-
<summary
|
|
507
|
-
|
|
496
|
+
<details>
|
|
497
|
+
<summary>Added in <code>0.6.0</code></summary>
|
|
498
|
+
<table>
|
|
499
|
+
<thead>
|
|
500
|
+
<tr><th>version</th><th>changes</th></tr>
|
|
501
|
+
</thead>
|
|
502
|
+
<tbody>
|
|
503
|
+
<tr><td><code>0.4.0</code></td><td>Originally named `ne`</td></tr>
|
|
504
|
+
</tbody>
|
|
505
|
+
</table>
|
|
508
506
|
</details>
|
|
509
507
|
|
|
510
508
|
```grain
|
|
511
|
-
|
|
509
|
+
(!=) : (x: Int64, y: Int64) => Bool
|
|
512
510
|
```
|
|
513
511
|
|
|
514
512
|
Checks if the first value is not equal to the second value.
|
|
@@ -534,7 +532,7 @@ No other changes yet.
|
|
|
534
532
|
</details>
|
|
535
533
|
|
|
536
534
|
```grain
|
|
537
|
-
eqz : Int64
|
|
535
|
+
eqz : (value: Int64) => Bool
|
|
538
536
|
```
|
|
539
537
|
|
|
540
538
|
Checks if the given value is equal to zero.
|
|
@@ -551,15 +549,22 @@ Returns:
|
|
|
551
549
|
|----|-----------|
|
|
552
550
|
|`Bool`|`true` if the first value is equal to zero or `false` otherwise|
|
|
553
551
|
|
|
554
|
-
### Int64.**
|
|
552
|
+
### Int64.**(<)**
|
|
555
553
|
|
|
556
|
-
<details
|
|
557
|
-
<summary
|
|
558
|
-
|
|
554
|
+
<details>
|
|
555
|
+
<summary>Added in <code>0.6.0</code></summary>
|
|
556
|
+
<table>
|
|
557
|
+
<thead>
|
|
558
|
+
<tr><th>version</th><th>changes</th></tr>
|
|
559
|
+
</thead>
|
|
560
|
+
<tbody>
|
|
561
|
+
<tr><td><code>0.2.0</code></td><td>Originally named `lt`</td></tr>
|
|
562
|
+
</tbody>
|
|
563
|
+
</table>
|
|
559
564
|
</details>
|
|
560
565
|
|
|
561
566
|
```grain
|
|
562
|
-
|
|
567
|
+
(<) : (x: Int64, y: Int64) => Bool
|
|
563
568
|
```
|
|
564
569
|
|
|
565
570
|
Checks if the first value is less than the second value.
|
|
@@ -577,41 +582,22 @@ Returns:
|
|
|
577
582
|
|----|-----------|
|
|
578
583
|
|`Bool`|`true` if the first value is less than the second value or `false` otherwise|
|
|
579
584
|
|
|
580
|
-
### Int64.**
|
|
585
|
+
### Int64.**(>)**
|
|
581
586
|
|
|
582
|
-
<details
|
|
583
|
-
<summary
|
|
584
|
-
|
|
587
|
+
<details>
|
|
588
|
+
<summary>Added in <code>0.6.0</code></summary>
|
|
589
|
+
<table>
|
|
590
|
+
<thead>
|
|
591
|
+
<tr><th>version</th><th>changes</th></tr>
|
|
592
|
+
</thead>
|
|
593
|
+
<tbody>
|
|
594
|
+
<tr><td><code>0.2.0</code></td><td>Originally named `gt`</td></tr>
|
|
595
|
+
</tbody>
|
|
596
|
+
</table>
|
|
585
597
|
</details>
|
|
586
598
|
|
|
587
599
|
```grain
|
|
588
|
-
|
|
589
|
-
```
|
|
590
|
-
|
|
591
|
-
Checks if the first unsigned value is less than the second unsigned value.
|
|
592
|
-
|
|
593
|
-
Parameters:
|
|
594
|
-
|
|
595
|
-
|param|type|description|
|
|
596
|
-
|-----|----|-----------|
|
|
597
|
-
|`x`|`Int64`|The first value|
|
|
598
|
-
|`y`|`Int64`|The second value|
|
|
599
|
-
|
|
600
|
-
Returns:
|
|
601
|
-
|
|
602
|
-
|type|description|
|
|
603
|
-
|----|-----------|
|
|
604
|
-
|`Bool`|`true` if the first value is less than the second value or `false` otherwise|
|
|
605
|
-
|
|
606
|
-
### Int64.**gt**
|
|
607
|
-
|
|
608
|
-
<details disabled>
|
|
609
|
-
<summary tabindex="-1">Added in <code>0.2.0</code></summary>
|
|
610
|
-
No other changes yet.
|
|
611
|
-
</details>
|
|
612
|
-
|
|
613
|
-
```grain
|
|
614
|
-
gt : (Int64, Int64) -> Bool
|
|
600
|
+
(>) : (x: Int64, y: Int64) => Bool
|
|
615
601
|
```
|
|
616
602
|
|
|
617
603
|
Checks if the first value is greater than the second value.
|
|
@@ -629,41 +615,22 @@ Returns:
|
|
|
629
615
|
|----|-----------|
|
|
630
616
|
|`Bool`|`true` if the first value is greater than the second value or `false` otherwise|
|
|
631
617
|
|
|
632
|
-
### Int64.**
|
|
618
|
+
### Int64.**(<=)**
|
|
633
619
|
|
|
634
|
-
<details
|
|
635
|
-
<summary
|
|
636
|
-
|
|
620
|
+
<details>
|
|
621
|
+
<summary>Added in <code>0.6.0</code></summary>
|
|
622
|
+
<table>
|
|
623
|
+
<thead>
|
|
624
|
+
<tr><th>version</th><th>changes</th></tr>
|
|
625
|
+
</thead>
|
|
626
|
+
<tbody>
|
|
627
|
+
<tr><td><code>0.2.0</code></td><td>Originally named `lte`</td></tr>
|
|
628
|
+
</tbody>
|
|
629
|
+
</table>
|
|
637
630
|
</details>
|
|
638
631
|
|
|
639
632
|
```grain
|
|
640
|
-
|
|
641
|
-
```
|
|
642
|
-
|
|
643
|
-
Checks if the first unsigned value is greater than the second unsigned value.
|
|
644
|
-
|
|
645
|
-
Parameters:
|
|
646
|
-
|
|
647
|
-
|param|type|description|
|
|
648
|
-
|-----|----|-----------|
|
|
649
|
-
|`x`|`Int64`|The first value|
|
|
650
|
-
|`y`|`Int64`|The second value|
|
|
651
|
-
|
|
652
|
-
Returns:
|
|
653
|
-
|
|
654
|
-
|type|description|
|
|
655
|
-
|----|-----------|
|
|
656
|
-
|`Bool`|`true` if the first value is greater than the second value or `false` otherwise|
|
|
657
|
-
|
|
658
|
-
### Int64.**lte**
|
|
659
|
-
|
|
660
|
-
<details disabled>
|
|
661
|
-
<summary tabindex="-1">Added in <code>0.2.0</code></summary>
|
|
662
|
-
No other changes yet.
|
|
663
|
-
</details>
|
|
664
|
-
|
|
665
|
-
```grain
|
|
666
|
-
lte : (Int64, Int64) -> Bool
|
|
633
|
+
(<=) : (x: Int64, y: Int64) => Bool
|
|
667
634
|
```
|
|
668
635
|
|
|
669
636
|
Checks if the first value is less than or equal to the second value.
|
|
@@ -681,41 +648,22 @@ Returns:
|
|
|
681
648
|
|----|-----------|
|
|
682
649
|
|`Bool`|`true` if the first value is less than or equal to the second value or `false` otherwise|
|
|
683
650
|
|
|
684
|
-
### Int64.**
|
|
651
|
+
### Int64.**(>=)**
|
|
685
652
|
|
|
686
|
-
<details
|
|
687
|
-
<summary
|
|
688
|
-
|
|
653
|
+
<details>
|
|
654
|
+
<summary>Added in <code>0.6.0</code></summary>
|
|
655
|
+
<table>
|
|
656
|
+
<thead>
|
|
657
|
+
<tr><th>version</th><th>changes</th></tr>
|
|
658
|
+
</thead>
|
|
659
|
+
<tbody>
|
|
660
|
+
<tr><td><code>0.2.0</code></td><td>Originally named `gte`</td></tr>
|
|
661
|
+
</tbody>
|
|
662
|
+
</table>
|
|
689
663
|
</details>
|
|
690
664
|
|
|
691
665
|
```grain
|
|
692
|
-
|
|
693
|
-
```
|
|
694
|
-
|
|
695
|
-
Checks if the first unsigned value is less than or equal to the second unsigned value.
|
|
696
|
-
|
|
697
|
-
Parameters:
|
|
698
|
-
|
|
699
|
-
|param|type|description|
|
|
700
|
-
|-----|----|-----------|
|
|
701
|
-
|`x`|`Int64`|The first value|
|
|
702
|
-
|`y`|`Int64`|The second value|
|
|
703
|
-
|
|
704
|
-
Returns:
|
|
705
|
-
|
|
706
|
-
|type|description|
|
|
707
|
-
|----|-----------|
|
|
708
|
-
|`Bool`|`true` if the first value is less than or equal to the second value or `false` otherwise|
|
|
709
|
-
|
|
710
|
-
### Int64.**gte**
|
|
711
|
-
|
|
712
|
-
<details disabled>
|
|
713
|
-
<summary tabindex="-1">Added in <code>0.2.0</code></summary>
|
|
714
|
-
No other changes yet.
|
|
715
|
-
</details>
|
|
716
|
-
|
|
717
|
-
```grain
|
|
718
|
-
gte : (Int64, Int64) -> Bool
|
|
666
|
+
(>=) : (x: Int64, y: Int64) => Bool
|
|
719
667
|
```
|
|
720
668
|
|
|
721
669
|
Checks if the first value is greater than or equal to the second value.
|
|
@@ -733,36 +681,6 @@ Returns:
|
|
|
733
681
|
|----|-----------|
|
|
734
682
|
|`Bool`|`true` if the first value is greater than or equal to the second value or `false` otherwise|
|
|
735
683
|
|
|
736
|
-
### Int64.**gteU**
|
|
737
|
-
|
|
738
|
-
<details disabled>
|
|
739
|
-
<summary tabindex="-1">Added in <code>0.5.0</code></summary>
|
|
740
|
-
No other changes yet.
|
|
741
|
-
</details>
|
|
742
|
-
|
|
743
|
-
```grain
|
|
744
|
-
gteU : (Int64, Int64) -> Bool
|
|
745
|
-
```
|
|
746
|
-
|
|
747
|
-
Checks if the first unsigned value is greater than or equal to the second unsigned value.
|
|
748
|
-
|
|
749
|
-
Parameters:
|
|
750
|
-
|
|
751
|
-
|param|type|description|
|
|
752
|
-
|-----|----|-----------|
|
|
753
|
-
|`x`|`Int64`|The first value|
|
|
754
|
-
|`y`|`Int64`|The second value|
|
|
755
|
-
|
|
756
|
-
Returns:
|
|
757
|
-
|
|
758
|
-
|type|description|
|
|
759
|
-
|----|-----------|
|
|
760
|
-
|`Bool`|`true` if the first value is greater than or equal to the second value or `false` otherwise|
|
|
761
|
-
|
|
762
|
-
## Bitwise logic
|
|
763
|
-
|
|
764
|
-
Boolean operations on the bits of Int64 values.
|
|
765
|
-
|
|
766
684
|
### Int64.**lnot**
|
|
767
685
|
|
|
768
686
|
<details disabled>
|
|
@@ -771,7 +689,7 @@ No other changes yet.
|
|
|
771
689
|
</details>
|
|
772
690
|
|
|
773
691
|
```grain
|
|
774
|
-
lnot : Int64
|
|
692
|
+
lnot : (value: Int64) => Int64
|
|
775
693
|
```
|
|
776
694
|
|
|
777
695
|
Computes the bitwise NOT of the given value.
|
|
@@ -788,15 +706,22 @@ Returns:
|
|
|
788
706
|
|----|-----------|
|
|
789
707
|
|`Int64`|Containing the inverted bits of the given value|
|
|
790
708
|
|
|
791
|
-
### Int64.**
|
|
709
|
+
### Int64.**(&)**
|
|
792
710
|
|
|
793
|
-
<details
|
|
794
|
-
<summary
|
|
795
|
-
|
|
711
|
+
<details>
|
|
712
|
+
<summary>Added in <code>0.6.0</code></summary>
|
|
713
|
+
<table>
|
|
714
|
+
<thead>
|
|
715
|
+
<tr><th>version</th><th>changes</th></tr>
|
|
716
|
+
</thead>
|
|
717
|
+
<tbody>
|
|
718
|
+
<tr><td><code>0.2.0</code></td><td>Originally named `land`</td></tr>
|
|
719
|
+
</tbody>
|
|
720
|
+
</table>
|
|
796
721
|
</details>
|
|
797
722
|
|
|
798
723
|
```grain
|
|
799
|
-
|
|
724
|
+
(&) : (x: Int64, y: Int64) => Int64
|
|
800
725
|
```
|
|
801
726
|
|
|
802
727
|
Computes the bitwise AND (`&`) on the given operands.
|
|
@@ -814,15 +739,22 @@ Returns:
|
|
|
814
739
|
|----|-----------|
|
|
815
740
|
|`Int64`|Containing a `1` in each bit position for which the corresponding bits of both operands are `1`|
|
|
816
741
|
|
|
817
|
-
### Int64.**
|
|
742
|
+
### Int64.**(|)**
|
|
818
743
|
|
|
819
|
-
<details
|
|
820
|
-
<summary
|
|
821
|
-
|
|
744
|
+
<details>
|
|
745
|
+
<summary>Added in <code>0.6.0</code></summary>
|
|
746
|
+
<table>
|
|
747
|
+
<thead>
|
|
748
|
+
<tr><th>version</th><th>changes</th></tr>
|
|
749
|
+
</thead>
|
|
750
|
+
<tbody>
|
|
751
|
+
<tr><td><code>0.2.0</code></td><td>Originally named `lor`</td></tr>
|
|
752
|
+
</tbody>
|
|
753
|
+
</table>
|
|
822
754
|
</details>
|
|
823
755
|
|
|
824
756
|
```grain
|
|
825
|
-
|
|
757
|
+
(|) : (x: Int64, y: Int64) => Int64
|
|
826
758
|
```
|
|
827
759
|
|
|
828
760
|
Computes the bitwise OR (`|`) on the given operands.
|
|
@@ -840,15 +772,22 @@ Returns:
|
|
|
840
772
|
|----|-----------|
|
|
841
773
|
|`Int64`|Containing a `1` in each bit position for which the corresponding bits of either or both operands are `1`|
|
|
842
774
|
|
|
843
|
-
### Int64.**
|
|
775
|
+
### Int64.**(^)**
|
|
844
776
|
|
|
845
|
-
<details
|
|
846
|
-
<summary
|
|
847
|
-
|
|
777
|
+
<details>
|
|
778
|
+
<summary>Added in <code>0.6.0</code></summary>
|
|
779
|
+
<table>
|
|
780
|
+
<thead>
|
|
781
|
+
<tr><th>version</th><th>changes</th></tr>
|
|
782
|
+
</thead>
|
|
783
|
+
<tbody>
|
|
784
|
+
<tr><td><code>0.2.0</code></td><td>Originally named `lxor`</td></tr>
|
|
785
|
+
</tbody>
|
|
786
|
+
</table>
|
|
848
787
|
</details>
|
|
849
788
|
|
|
850
789
|
```grain
|
|
851
|
-
|
|
790
|
+
(^) : (x: Int64, y: Int64) => Int64
|
|
852
791
|
```
|
|
853
792
|
|
|
854
793
|
Computes the bitwise XOR (`^`) on the given operands.
|
|
@@ -874,7 +813,7 @@ No other changes yet.
|
|
|
874
813
|
</details>
|
|
875
814
|
|
|
876
815
|
```grain
|
|
877
|
-
clz : Int64
|
|
816
|
+
clz : (value: Int64) => Int64
|
|
878
817
|
```
|
|
879
818
|
|
|
880
819
|
Counts the number of leading zero bits in the value.
|
|
@@ -899,7 +838,7 @@ No other changes yet.
|
|
|
899
838
|
</details>
|
|
900
839
|
|
|
901
840
|
```grain
|
|
902
|
-
ctz : Int64
|
|
841
|
+
ctz : (value: Int64) => Int64
|
|
903
842
|
```
|
|
904
843
|
|
|
905
844
|
Counts the number of trailing zero bits in the value.
|
|
@@ -924,7 +863,7 @@ No other changes yet.
|
|
|
924
863
|
</details>
|
|
925
864
|
|
|
926
865
|
```grain
|
|
927
|
-
popcnt : Int64
|
|
866
|
+
popcnt : (value: Int64) => Int64
|
|
928
867
|
```
|
|
929
868
|
|
|
930
869
|
Counts the number of bits set to `1` in the value, also known as a population count.
|
|
@@ -941,3 +880,29 @@ Returns:
|
|
|
941
880
|
|----|-----------|
|
|
942
881
|
|`Int64`|The amount of 1-bits in its operand|
|
|
943
882
|
|
|
883
|
+
### Int64.**(\*\*)**
|
|
884
|
+
|
|
885
|
+
<details disabled>
|
|
886
|
+
<summary tabindex="-1">Added in <code>0.6.0</code></summary>
|
|
887
|
+
No other changes yet.
|
|
888
|
+
</details>
|
|
889
|
+
|
|
890
|
+
```grain
|
|
891
|
+
(**) : (base: Int64, power: Int64) => Int64
|
|
892
|
+
```
|
|
893
|
+
|
|
894
|
+
Computes the exponentiation of the given base and power.
|
|
895
|
+
|
|
896
|
+
Parameters:
|
|
897
|
+
|
|
898
|
+
|param|type|description|
|
|
899
|
+
|-----|----|-----------|
|
|
900
|
+
|`base`|`Int64`|The base number|
|
|
901
|
+
|`power`|`Int64`|The exponent number|
|
|
902
|
+
|
|
903
|
+
Returns:
|
|
904
|
+
|
|
905
|
+
|type|description|
|
|
906
|
+
|----|-----------|
|
|
907
|
+
|`Int64`|The base raised to the given power|
|
|
908
|
+
|