version 1.1, 1994/02/11 16:30:46
|
version 1.3, 1994/05/31 07:26:23
|
Line 3
|
Line 3
|
: faligned ( addr -- f-addr ) |
: faligned ( addr -- f-addr ) |
[ 1 floats 1- ] Literal + [ -1 floats ] Literal and ; |
[ 1 floats 1- ] Literal + [ -1 floats ] Literal and ; |
|
|
: falign ( -- ) here dup aligned swap |
: falign ( -- ) |
|
here dup aligned swap |
?DO bl c, LOOP ; |
?DO bl c, LOOP ; |
|
|
: f, ( f -- ) here 1 floats allot f! ; |
: f, ( f -- ) here 1 floats allot f! ; |
|
|
|
\ !! have create produce faligned pfas |
: fconstant ( r -- ) |
: fconstant ( r -- ) |
Create falign f, |
Create falign f, |
DOES> faligned f@ ; |
DOES> faligned f@ ; |
Line 34
|
Line 36
|
|
|
: f. ( r -- ) scratch represent 0= |
: f. ( r -- ) scratch represent 0= |
IF 2drop scratch 3 min type EXIT THEN |
IF 2drop scratch 3 min type EXIT THEN |
IF '- emit THEN dup >r 0< |
IF '- emit THEN dup >r 0<= |
IF '0 emit |
IF '0 emit |
ELSE scratch r@ min type r@ precision - zeros THEN |
ELSE scratch r@ min type r@ precision - zeros THEN |
'. emit r@ negate zeros |
'. emit r@ negate zeros |
scratch r> 0 max /string 0 max -zeros type space ; |
scratch r> 0 max /string 0 max -zeros type space ; |
|
\ I'm afraid this does not really implement ansi semantics wrt precision. |
|
\ Shouldn't precision indicate the number of places shown after the point? |
|
|
: fe. ( r -- ) scratch represent 0= |
: fe. ( r -- ) scratch represent 0= |
IF 2drop scratch 3 min type EXIT THEN |
IF 2drop scratch 3 min type EXIT THEN |