Hello all,
The ever reappearing questions on floating point numbers, their decimal representation and why converted values do not look as expected inspired me to develop a small utility.
Every finite binary floating point can be converted to an exact finite decimal representation and the tool does exactly that for Single & Double types.
It converts to a fixed point decimal representation, is reasonably fast - in the range of FloatToStr - and supports a small memory model build.
It should run on 32/64 big/little target architectures, but so far is only tested on x86-64 in 64 bit mode.
Beside the conversion unit there is
- a command-line unit test build on consoleapprunner
- a command-line table generation unit (in case the required tables get lost)
- a command-line benchmark utility
The tool targets my own amusement and maybe educational use.
Feedback in any form is appreciated.
Cheers,
MathMan