Why can't we use Go way to use fast algorithm where round off won't be required and keep the slow correct algorithm for the one where round off will be required.
As I am experimenting with Rust, I noticed it's string to float method is considerably slower than hand written code. Golang string to float is also faster than Rust's. Why can't we use Go way to use fast algorithm where round off won't be required and keep the slow correct algorithm for the one where round off will be required.
No any search results
You already invited:
1 Answers
fidel
Upvotes from:
However, if you'd need to change the API (eg. offering two parsing methods instead of one), then that would need to go through the full RFC process (and changing behaviour of the current one would probably not be accepted, things are supposed to stay compatible).
Anyway, in general, if there's a balancing between correctness and speed, Rust first tries to do both and if that fails, prefers correctness in the place where people are going to reach for the thing first (and maybe offer alternatives as additional methods or something).