Recent

Author Topic: Floating Point Utility  (Read 278 times)

MathMan

  • Hero Member
  • *****
  • Posts: 501
Floating Point Utility
« on: May 06, 2026, 01:58:36 pm »
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

schuler

  • Sr. Member
  • ****
  • Posts: 336
Re: Floating Point Utility
« Reply #1 on: May 06, 2026, 09:05:10 pm »
git repo?

MathMan

  • Hero Member
  • *****
  • Posts: 501
Re: Floating Point Utility
« Reply #2 on: May 06, 2026, 09:19:06 pm »
Hm,

Have been thinking about getting acquaintant with git from time to time. In the past it has always turned out - nah.

But due to your nudge I'll think it over again.

schuler

  • Sr. Member
  • ****
  • Posts: 336
Re: Floating Point Utility
« Reply #3 on: May 07, 2026, 11:17:18 am »
easier to inspect code, submit issues, PRs, look at the readme and even give it a star!

 

TinyPortal © 2005-2018