@grain/stdlib 0.4.5 → 0.4.6
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 +7 -0
- package/LICENSE +1 -1
- package/float32.gr +120 -4
- package/float32.md +315 -0
- package/float64.gr +120 -4
- package/float64.md +315 -0
- package/int32.gr +370 -75
- package/int32.md +833 -0
- package/int64.gr +370 -75
- package/int64.md +833 -0
- package/package.json +1 -1
- package/runtime/numberUtils.gr +7 -5
- package/string.gr +2 -2
- package/sys/file.gr +1 -1
package/package.json
CHANGED
package/runtime/numberUtils.gr
CHANGED
|
@@ -1104,11 +1104,13 @@ let grisuRound = (buffer, len, delta, rest, ten_kappa, wp_w) => {
|
|
|
1104
1104
|
while (
|
|
1105
1105
|
WasmI64.ltU(rest, wp_w) &&
|
|
1106
1106
|
WasmI64.geU(WasmI64.sub(delta, rest), ten_kappa) &&
|
|
1107
|
-
(
|
|
1108
|
-
|
|
1109
|
-
WasmI64.
|
|
1110
|
-
|
|
1111
|
-
|
|
1107
|
+
(
|
|
1108
|
+
WasmI64.ltU(WasmI64.add(rest, ten_kappa), wp_w) ||
|
|
1109
|
+
WasmI64.gtU(
|
|
1110
|
+
WasmI64.sub(wp_w, rest),
|
|
1111
|
+
WasmI64.sub(WasmI64.add(rest, ten_kappa), wp_w)
|
|
1112
|
+
)
|
|
1113
|
+
)
|
|
1112
1114
|
) {
|
|
1113
1115
|
digit -= 1n
|
|
1114
1116
|
rest = WasmI64.add(rest, ten_kappa)
|
package/string.gr
CHANGED
|
@@ -1635,7 +1635,7 @@ let rec decodeRangeHelp =
|
|
|
1635
1635
|
// high surrogate. next character is low srurrogate
|
|
1636
1636
|
let w1 = (w1 & 0x03FFn) << 10n
|
|
1637
1637
|
let w2 = (WasmI32.load8U(bytesPtr, 2n) << 8n |
|
|
1638
|
-
|
|
1638
|
+
WasmI32.load8U(bytesPtr, 3n)) &
|
|
1639
1639
|
0x03FFn
|
|
1640
1640
|
let codeWord = w1 + w2 + 0x10000n
|
|
1641
1641
|
// no problems, so go past both code words
|
|
@@ -1658,7 +1658,7 @@ let rec decodeRangeHelp =
|
|
|
1658
1658
|
// high surrogate. next character is low srurrogate
|
|
1659
1659
|
let w1 = (w1 & 0x03FFn) << 10n
|
|
1660
1660
|
let w2 = (WasmI32.load8U(bytesPtr, 3n) << 8n |
|
|
1661
|
-
|
|
1661
|
+
WasmI32.load8U(bytesPtr, 2n)) &
|
|
1662
1662
|
0x03FFn
|
|
1663
1663
|
//let uPrime = codePoint - 0x10000n
|
|
1664
1664
|
//let w1 = ((uPrime & 0b11111111110000000000n) >>> 10n) + 0xD800n // High surrogate
|
package/sys/file.gr
CHANGED
|
@@ -904,7 +904,7 @@ export let rec fdStats = (fd: FileDescriptor) => {
|
|
|
904
904
|
let flagsToWasmVal = (flag, i) => {
|
|
905
905
|
let rightsInheriting = WasmI64.load(structPtr, 16n)
|
|
906
906
|
(rightsInheriting &
|
|
907
|
-
|
|
907
|
+
1N << WasmI64.extendI32U(WasmI32.fromGrain(i) >> 1n)) >
|
|
908
908
|
0N
|
|
909
909
|
}
|
|
910
910
|
Memory.incRef(WasmI32.fromGrain(List.filteri))
|