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


Groups > comp.lang.forth > #135701

Re: ddfloat library: the behavior of >dd

Date 2026-09-15 01:32 +1000
From dxf <dxforth@gmail.com>
Subject Re: ddfloat library: the behavior of >dd
Newsgroups comp.lang.forth
References (10 earlier) <1188a3t$2v3j3$1@dont-email.me> <6aa7c5cf$1@news.ausics.net> <1188htd$2vabu$1@dont-email.me> <6aa7e1b3$1@news.ausics.net> <1188p58$1al9l$1@dont-email.me>
Message-ID <6aa81377$1@news.ausics.net> (permalink)
Organization Ausics - https://newsgroups.ausics.net

Show all headers | View raw


On 14/09/2026 10:26 pm, marcel hendrix wrote:
> On 9/14/2026 1:59 PM, dxf wrote:
>> On 14/09/2026 8:22 pm, marcel hendrix wrote:
> [..]> The looping was caused by  NAN 10E F< 0=  ... which always returned TRUE.
>> Changing to an integrated  F>=  cured the looping.  The NAN came from:
>> ( 1dd307)  dd10 307 DD^N  DD/  ( NAN NAN)
>>
>> Presumably you don't get this (on the FPU stack)?
> 
> A NAN can't be compared to anything. I have (ISNAN) and (NOTFIN) to detect these patterns. My (DDFE.) is
> \ create memory string for double-double in E-format
> : (DDFE.) ( F: x xx -- ) ( -- c-addr u )
>     FOVER F0=      IF  DDDROP S"  0e"   EXIT  ENDIF
>     FDUP  (ISNAN)  IF  DDDROP S"  NaN2" EXIT  ENDIF
>     FOVER (ISNAN)  IF  DDDROP S"  NaN1" EXIT  ENDIF
>     FDUP  (NOTFIN) IF  DDDROP S"  Inf"  EXIT  ENDIF
>     FOVER (NOTFIN) IF  DDDROP S"  Inf"  EXIT  ENDIF
>     getSign                   ( -- s )
>     getPower   ( F: x xx -- ) ( -- s n  )
>     normalize  ( F: y yy -- ) ( -- s n' )
>     (ddout)    F2DROP ;
> ...

Those won't handle non-reals generated by NORMALIZE.  For DDFS. I've narrowed
the issue down to:

  ( 1dd307 1dd307 ) DD/

It should produce 1dd0 but fails giving NAN NAN instead.

> At the moment all but one of the bugs I mentioned before are fixed.
> It is not possible to do S" 1" >dd because my >dd wants to see at least
> S" 1." or S" 1e". I don't feel like fixing that (yet).

Since my >DD can't generate 1dd307, I looked into that too:

  ( 1dd0 )  307 0 ?DO  dd10 DD*  LOOP

will fail, producing NAN NAN instead.

So DD* and DD/ on my system (also Win32Forth, Gforth) are limited to 1E+-300.
For various reasons unrelated to the code you seem to be getting somewhat
better results.

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


Thread

ddfloat library: the behavior of >dd marcel hendrix <mhx@iae.nl> - 2026-09-10 19:33 +0200
  Re: ddfloat library: the behavior of >dd Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-09-10 13:35 -0500
    Re: ddfloat library: the behavior of >dd marcel hendrix <mhx@iae.nl> - 2026-09-10 22:10 +0200
      Re: ddfloat library: the behavior of >dd Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-09-10 16:51 -0500
  Re: ddfloat library: the behavior of >dd dxf <dxforth@gmail.com> - 2026-09-11 12:16 +1000
    Re: ddfloat library: the behavior of >dd marcel hendrix <mhx@iae.nl> - 2026-09-11 12:05 +0200
      Re: ddfloat library: the behavior of >dd marcel hendrix <mhx@iae.nl> - 2026-09-12 00:27 +0200
        Re: ddfloat library: the behavior of >dd Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-09-11 20:29 -0500
          Re: ddfloat library: the behavior of >dd dxf <dxforth@gmail.com> - 2026-09-12 12:02 +1000
            Re: ddfloat library: the behavior of >dd Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-09-12 10:24 -0500
          Re: ddfloat library: the behavior of >dd marcel hendrix <mhx@iae.nl> - 2026-09-12 10:45 +0200
            Re: ddfloat library: the behavior of >dd dxf <dxforth@gmail.com> - 2026-09-12 19:51 +1000
            Re: ddfloat library: the behavior of >dd dxf <dxforth@gmail.com> - 2026-09-12 22:47 +1000
              Re: ddfloat library: the behavior of >dd dxf <dxforth@gmail.com> - 2026-09-13 03:14 +1000
                Re: ddfloat library: the behavior of >dd Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-09-12 13:02 -0500
                Re: ddfloat library: the behavior of >dd dxf <dxforth@gmail.com> - 2026-09-13 15:44 +1000
                Re: ddfloat library: the behavior of >dd marcel hendrix <mhx@iae.nl> - 2026-09-13 09:00 +0200
                Re: ddfloat library: the behavior of >dd dxf <dxforth@gmail.com> - 2026-09-13 20:33 +1000
                Re: ddfloat library: the behavior of >dd dxf <dxforth@gmail.com> - 2026-09-14 13:28 +1000
                Re: ddfloat library: the behavior of >dd marcel hendrix <mhx@iae.nl> - 2026-09-14 10:09 +0200
                Re: ddfloat library: the behavior of >dd dxf <dxforth@gmail.com> - 2026-09-14 20:00 +1000
                Re: ddfloat library: the behavior of >dd marcel hendrix <mhx@iae.nl> - 2026-09-14 12:22 +0200
                Re: ddfloat library: the behavior of >dd dxf <dxforth@gmail.com> - 2026-09-14 21:59 +1000
                Re: ddfloat library: the behavior of >dd marcel hendrix <mhx@iae.nl> - 2026-09-14 14:26 +0200
                Re: ddfloat library: the behavior of >dd dxf <dxforth@gmail.com> - 2026-09-15 01:32 +1000
                Re: ddfloat library: the behavior of >dd marcel hendrix <mhx@iae.nl> - 2026-09-14 21:08 +0200
                Re: ddfloat library: the behavior of >dd Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-09-14 15:25 -0500
                Re: ddfloat library: the behavior of >dd dxf <dxforth@gmail.com> - 2026-09-15 13:11 +1000
                Re: ddfloat library: the behavior of >dd marcel hendrix <mhx@iae.nl> - 2026-09-15 14:06 +0200
                Re: ddfloat library: the behavior of >dd dxf <dxforth@gmail.com> - 2026-09-16 00:05 +1000
                Re: ddfloat library: the behavior of >dd anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-09-14 15:00 +0000
                Re: ddfloat library: the behavior of >dd marcel hendrix <mhx@iae.nl> - 2026-09-14 21:15 +0200
                Re: ddfloat library: the behavior of >dd Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-09-14 15:29 -0500
                Re: ddfloat library: the behavior of >dd anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-09-14 20:58 +0000
                Re: ddfloat library: the behavior of >dd Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-09-15 07:33 -0500
                Re: ddfloat library: the behavior of >dd anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-09-15 15:53 +0000
                Re: ddfloat library: the behavior of >dd Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-09-15 15:23 -0500
                Re: ddfloat library: the behavior of >dd Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-09-15 17:53 -0500

csiph-web