AssemblyScript currently uses a pretty old Grisu2-based algorithm for f32/f64 to string conversion. Will be great to rewrite this using Zmij, which is a newer shortest-roundtrip algorithm and should be much faster and probably more precise in some rare cases. SIMD should be optional.
Current implementation: https://github.com/AssemblyScript/assemblyscript/blob/main/std/assembly/util/number.ts#L729
Tests: https://github.com/AssemblyScript/assemblyscript/blob/main/tests/compiler/std/string.ts#L736
C++ Reference: https://github.com/vitaut/zmij
Rust port: https://github.com/dtolnay/zmij
AssemblyScript currently uses a pretty old
Grisu2-based algorithm forf32/f64to string conversion. Will be great to rewrite this usingZmij, which is a newer shortest-roundtrip algorithm and should be much faster and probably more precise in some rare cases. SIMD should be optional.Current implementation: https://github.com/AssemblyScript/assemblyscript/blob/main/std/assembly/util/number.ts#L729
Tests: https://github.com/AssemblyScript/assemblyscript/blob/main/tests/compiler/std/string.ts#L736
C++ Reference: https://github.com/vitaut/zmij
Rust port: https://github.com/dtolnay/zmij