Closed demurgos closed 5 years ago
The Rust precision works fine in fact. The issue is that V8 treats all floats as f64 and serializes with a high precision while serde serializes as an f32 and uses less digits. Here is the neighborhood of the example value with serde:
0.4772949 prev
0.47729492 value
0.47729495 next
This is not a parser issue but an AST one.
The Rust implementation of
transmute_u16_to_f16
is losing precision.Example:
But Rust returns
0.47729492
.