[gforth] / gforth / kernel / int.fs  

gforth: gforth/kernel/int.fs

Diff for /gforth/kernel/int.fs between version 1.20 and 1.21

version 1.20, Sat Feb 20 22:13:23 1999 UTC version 1.21, Sat Feb 20 23:29:49 1999 UTC
Line 100 
Line 100 
     r> ;      r> ;
   
 : s>unumber? ( addr u -- ud flag )  : s>unumber? ( addr u -- ud flag )
       base @ >r  dpl on  getbase
     0. 2swap      0. 2swap
     BEGIN ( d addr len )      BEGIN ( d addr len )
         dup >r >number dup          dup >r >number dup
Line 110 
Line 111 
     WHILE \ the current char is '.'      WHILE \ the current char is '.'
         1 /string          1 /string
     REPEAT  THEN \ there are unparseable characters left      REPEAT  THEN \ there are unparseable characters left
         rdrop 2drop false          2drop false
     ELSE      ELSE
         rdrop 2drop true          rdrop 2drop true
     THEN ;      THEN
       r> base ! ;
   
 \ ouch, this is complicated; there must be a simpler way - anton  \ ouch, this is complicated; there must be a simpler way - anton
 : s>number? ( addr len -- d f )  : s>number? ( addr len -- d f )
     \ converts string addr len into d, flag indicates success      \ converts string addr len into d, flag indicates success
     base @ >r  dpl on   sign? >r  getbase      sign? >r
     s>unumber?      s>unumber?
     0= IF      0= IF
         false          rdrop false
     ELSE \ no characters left, all ok      ELSE \ no characters left, all ok
         r>          r>
         IF          IF
             dnegate              dnegate
         THEN          THEN
         true          true
     THEN      THEN ;
     r> base ! ;  
   
 : s>number ( addr len -- d )  : s>number ( addr len -- d )
     \ don't use this, there is no way to tell success      \ don't use this, there is no way to tell success


Generate output suitable for use with a patch program
Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

CVS Admin

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help