Hi, 

in case of "1.234e" "1.234" "1.234e0" string>float drops the "0" exp
from rstack :

: string>float ( c-addr u-length -- f )
\ get exponent first -- this is the number that follows e, E, d, or
D
101 extract dup 0= if drop \ 'e'
69 extract dup 0= if drop  \ 'E'
100 extract dup 0= if drop \ 'd'
68 extract dup 0=        \ 'D'  ##### <<< Pito: dup 0= if
then then then         \ ##### <<< Pito: then then then then 
>r ( adr length, R: exp )
....
and the:
\ now, shift according to exp
r> dup 0=  
if    
drop  else

returns a wrong result. With #### up there it returns "0" from
rstack (an error from partnumber but a correct exp) which "could be
taken" as a good exp ("0" in those cases) so we may get the right
result for above floats (when "now, shift according to exp" will be
changed somehow). P.


------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Amforth-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amforth-devel

Reply via email to