wduquette / molt

Embeddable TCL Interpreter for Rust applications
BSD 3-Clause "New" or "Revised" License
103 stars 12 forks source link

Floating point formatting #29

Open wduquette opened 5 years ago

wduquette commented 5 years ago

Molt relies on Rust's default floating point string formatting (except for special handling for Inf, -Inf, and NaN); and Rust's default formatting isn't what we need. In particular, we need to be very sure that (A) the output is pleasant for humans to read and (B) will be parsed into exactly the same number. Tcl 8 has a detailed algorithm for this.