Commit Graph

6 Commits

Author SHA1 Message Date
Guillaume Gomez 38eb369fa4 Enforce Python 3 as much as possible 2020-04-10 09:09:58 -04:00
Chris Simpkins f38e2701d8 remove unnecessary sys import 2020-02-07 23:49:40 -05:00
David Tolnay d353a4c267
Make dec2flt_table compatible with rustfmt 2019-11-29 20:17:09 -08:00
Mark Rousskov 2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
Robin Kruppe dad1df6c1a Speed up dec2flt fast path with additional tables.
Add tables of small powers of ten used in the fast path. The tables are redundant: We could also use the big, more accurate table and round the value to the correct type (in fact we did just that before this commit). However, the rounding is extra work and slows down the fast path.

Because only very small exponents enter the fast path, the table and thus the space overhead is negligible. Speed-wise, this is a clear win on a [benchmark] comparing the fast path to a naive, hand-optimized, inaccurate algorithm. Specifically, this change narrows the gap from a roughly 5x difference to a roughly 3.4x difference.

[benchmark]: https://gist.github.com/Veedrac/dbb0c07994bc7882098e
2016-01-12 22:25:16 +01:00
Robin Kruppe b7e39a1c2d Script for generating the powers-of-ten tables necessary for correct and
fast decimal-to-float conversions.
2015-08-08 17:15:25 +02:00