Re: Negative Zero (was Re: Rfd: floating point truncation)



David N. Williams wrote:
Marcel Hendrix wrote:
> I wrote:
>
>> S" -0" >FLOAT drop -0e 0e F~ . should return -1. Do all Forth's do this?
>> Do all standard Forths return -1 in case of evaluating -0e -0e 0e F~ ?
>
> Hmm, of course they all will, even when they're wrong :-)
>
> Please fix with system-dependent magic before answering.
:-)

A slightly different issue:

pfe:
0e -0e 0e F~ . 0 ok
0e f. -0.000000 ok

gforth:
0e -0e 0e F~ . 0 ok
-0e f. 0. ok

So not all systems that understand -0e internally also print it.

This is not uncommon. VFX and SwiftForth both do this.

So how should such systems be classified? Do they support
negative zero - or not? Ostensibly they don't, but F~ and
the real to IEEE conversion functions may say otherwise.






.



Relevant Pages

  • Re: >ORDER ORDER> ORDER@
    ... > one thing I miss now and then in standard code, and just a week ago I ... I would welcome an RfD that proposes it. ... Anthologist: David N. Williams ...
    (comp.lang.forth)
  • Re: any-find & win min ?
    ... win min fix info. ... David ... > | Sysclean found Troj_Agent.el but could not clean it. ... > | connection had Any-Find as the home page until I changed it again. ...
    (microsoft.public.security.virus)
  • Current standings: Structures
    ... David N. Williams ... SFIELD: 2 cells ... The semantics of DFIELD: ...
    (comp.lang.forth)
  • linux-2.4.23 released
    ... o Fix modular IDE ... David Engebretsen: ... o Fix ST16C654 UART support broke by ELAN patches ... o USB: ...
    (Linux-Kernel)
  • Re: XP wont start, reporting Windows file errors
    ... I solve the password problem and tried your suggestion but it didn't fix the ... "David B." ... console and run chkdsk /r ... I want to fix my files with my original OS disk but this is a SP1 ...
    (microsoft.public.windowsxp.help_and_support)