Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #135337

Re: kForth-Win32 fix for decimal string to double float conversion

From Krishna Myneni <krishna.myneni@ccreweb.org>
Newsgroups comp.lang.forth
Subject Re: kForth-Win32 fix for decimal string to double float conversion
Date 2026-08-11 07:24 -0500
Organization A noiseless patient Spider
Message-ID <115f496$3vfs9$1@dont-email.me> (permalink)
References <113lcfk$18opt$1@dont-email.me>

Show all headers | View raw


On 7/20/26 09:48, Krishna Myneni wrote:
...

> "Correctly Rounded Binary-Decimal and Decimal-Binary Conversions," David 
> M. Gay, Numerical Analysis Manuscript 90-10, AT&T Bell Laboratories, 30 
> November 1990.
> 
> and the corresponding code, dtoa.c, link below, which provides a high- 
> quality strtod() replacement function for decimal string to binary 
> floating point conversions, as well as the inverse function, dtoa().
> 
> https://netlib.org/fp/dtoa.c
> 
> The kForth system test code, fpio-test.4th, may be used to identify 
> problems with decimal string conversion to IEEE double floats in other 
> Forth systems. The test file may be found at the link below.
> 
> https://github.com/mynenik/kForth-Win32/blob/master/forth-src/system- 
> test/fpio-test.4th
> 
...
I recently found a paper by Vern Paxson, a student of William Kahan, "A 
Program for Testing IEEE Decimal-Binary Conversion," 22 May 1991. This 
nicely written paper was apparently written for a CS class. It contains 
tables for "difficult" Decimal -> Binary conversions and for Binary -> 
Decimal conversions, with difficult meaning the required extra 
arithmetic precision over the starting precision (53 bits) in order to 
convert to the nearest double precision floating point which can be 
represented.


For example, Table 1. indicates that converting the double-precision 
floating point number, 4891559871276714924261E+222 requires an 
arithmetic precision of 53 + 86 = 139 bits.

The paper may be found at

https://www.icir.org/vern/papers/testbase-report.pdf

I am in the process of updating fpio-test.4th to include the conversion 
"stress tests" from Tables 1 through 4 of the paper. The Forth big 
number arithmetic code (FSL #47) may be used to check that the binary 
values of the significand and exponent (power of 2) are correct for 
decimal to binary conversions.

--
Krishna

Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

kForth-Win32 fix for decimal string to double float conversion Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-07-20 09:48 -0500
  Re: kForth-Win32 fix for decimal string to double float conversion albert@SPENARNC.XS4ALL.NL - 2026-07-21 11:40 +0200
    Re: kForth-Win32 fix for decimal string to double float conversion Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-07-21 06:20 -0500
      Re: kForth-Win32 fix for decimal string to double float conversion albert@SPENARNC.XS4ALL.NL - 2026-07-25 16:08 +0200
        Re: kForth-Win32 fix for decimal string to double float conversion peter <peter.noreply@tin.it> - 2026-07-25 17:07 +0200
          Re: kForth-Win32 fix for decimal string to double float conversion Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-07-25 13:22 -0500
            Re: kForth-Win32 fix for decimal string to double float conversion Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-07-25 13:30 -0500
        Re: kForth-Win32 fix for decimal string to double float conversion Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-07-25 13:17 -0500
          Re: kForth-Win32 fix for decimal string to double float conversion dxf <dxforth@gmail.com> - 2026-07-26 13:15 +1000
            Re: kForth-Win32 fix for decimal string to double float conversion Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-07-26 07:18 -0500
              Re: kForth-Win32 fix for decimal string to double float conversion dxf <dxforth@gmail.com> - 2026-07-31 14:54 +1000
                Re: kForth-Win32 fix for decimal string to double float conversion anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-07-31 08:35 +0000
                Re: kForth-Win32 fix for decimal string to double float conversion albert@spenarnc.xs4all.nl - 2026-07-31 12:05 +0200
                Re: kForth-Win32 fix for decimal string to double float conversion Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-07-31 07:54 -0500
                Re: kForth-Win32 fix for decimal string to double float conversion anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-07-31 16:55 +0000
                Re: kForth-Win32 fix for decimal string to double float conversion Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-07-31 14:40 -0500
                Re: kForth-Win32 fix for decimal string to double float conversion anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-08-01 08:23 +0000
                Re: kForth-Win32 fix for decimal string to double float conversion Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-08-01 06:42 -0500
    Re: kForth-Win32 fix for decimal string to double float conversion Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-07-21 11:30 -0500
      Re: kForth-Win32 fix for decimal string to double float conversion Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-07-21 14:47 -0500
  Re: kForth-Win32 fix for decimal string to double float conversion albert@SPENARNC.XS4ALL.NL - 2026-07-25 23:42 +0200
    Re: kForth-Win32 fix for decimal string to double float conversion Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-07-25 18:47 -0500
      Re: kForth-Win32 fix for decimal string to double float conversion albert@SPENARNC.XS4ALL.NL - 2026-07-26 13:11 +0200
  Re: kForth-Win32 fix for decimal string to double float conversion albert@SPENARNC.XS4ALL.NL - 2026-07-26 13:22 +0200
    Re: kForth-Win32 fix for decimal string to double float conversion Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-07-26 07:23 -0500
      Re: kForth-Win32 fix for decimal string to double float conversion albert@SPENARNC.XS4ALL.NL - 2026-07-26 20:13 +0200
        Re: kForth-Win32 fix for decimal string to double float conversion Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-07-27 12:20 -0500
  Re: kForth-Win32 fix for decimal string to double float conversion Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-08-11 07:24 -0500
  Re: kForth-Win32 fix for decimal string to double float conversion Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-08-24 18:55 -0500

csiph-web