bug-gforth
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug ? float stack initiated with "1.00000" in Debian11 64bits and


From: Pascal Dag
Subject: Bug ? float stack initiated with "1.00000" in Debian11 64bits and
Date: Sat, 20 May 2023 10:55:09 +0000 (UTC)

With the code...



FVARIABLE X
FVARIABLE Y
FVARIABLE Z
FVARIABLE T
FVARIABLE L

: D_RPNS ( -- )        \  print out Stack ONLY for debugging purpose
    CR
    ." X " X F@ F. CR
    ." Y " Y F@ F. CR
    ." Z " Z F@ F. CR
    ." T " T F@ F. CR
    ." L " L F@ F. CR
    CR
    F.S
    CR

: TEST ( -- )
    CLEARSTACK
    2.0e FDUP Y F!
    CR D_RPNS
    5.0e FDUP X F!
    CR ." Test function prior start PERE12" D_RPNS
    ;


The Terminal output is..

test

X 0.
Y 2.
Z 0.
T 0.
L 0.

<2> 1.000000000000E0 2.000000000000E0

Test function prior start PERE12
X 5.
Y 2.
Z 0.
T 0.
L 0.

<3> 1.000000000000E0 2.000000000000E0 5.000000000000E0


Where is the 1.000000000000E0  coming from? Is it a bug? It can be deleted from the stack with FNIP. But for me this is weird FNIP must be used to delete a number which appeared in the stack.


Then it turns to be ok


: TEST ( -- )
    CLEARSTACK
    2.0e FDUP Y F!
    FNIP
    CR D_RPNS
    5.0e FDUP X F!
    CR ." Test function prior start PERE12" D_RPNS
    ;


then the output is fine,,,


test

X 0.
Y 2.
Z 0.
T 0.
L 0.

<1> 2.000000000000E0

Test function prior start PERE12
X 5.
Y 2.
Z 0.
T 0.
L 0.

<2> 2.000000000000E0 5.000000000000E0



gforth 0.7.3 fromDebian 11.

uname -a
Linux ProDesk 5.10.0-23-amd64 #1 SMP Debian 5.10.179-1 (2023-05-12) x86_64 GNU/Linux

apt list gforth
Listing... Done
gforth/stable,now 0.7.3+dfsg-9+b1 amd64 [installed]
gforth/stable 0.7.3+dfsg-9+b1 i386


Any remark / comment is welcome.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]