Skip to content

Commit c165ee5

Browse files
MaxGraeydcodeIO
authored andcommitted
Rework strtod and parseFloat (#768)
Also fixes an issue with String.fromCodePoint and improves strtol
1 parent 11ab3a6 commit c165ee5

File tree

6 files changed

+16092
-10416
lines changed

6 files changed

+16092
-10416
lines changed

Diff for: std/assembly/index.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1501,6 +1501,8 @@ interface INativeMath<T> extends IMath<T> {
15011501
sincos_cos: T;
15021502
/** Seeds the random number generator. */
15031503
seedRandom(value: i64): void;
1504+
/** Multiplies a floating point `x` by 2 raised to power exp `n`. */
1505+
scalbn(x: T, n: i32): T;
15041506
/** Returns the floating-point remainder of `x / y` (rounded towards zero). */
15051507
mod(x: T, y: T): T;
15061508
/** Returns the floating-point remainder of `x / y` (rounded to nearest). */

Diff for: std/assembly/string.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ import { idof } from "./builtins";
2626
store<u16>(out, <u16>code);
2727
} else {
2828
code -= 0x10000;
29-
let hi: u32 = (code >>> 10) + 0xD800;
3029
let lo: u32 = (code & 0x3FF) + 0xDC00;
31-
store<u32>(out, (hi << 16) | lo);
30+
let hi: u32 = (code >>> 10) + 0xD800;
31+
store<u32>(out, hi | (lo << 16));
3232
}
3333
return changetype<string>(out); // retains
3434
}

0 commit comments

Comments
 (0)