--- gforth/float.fs 2002/10/27 09:57:10 1.37 +++ gforth/float.fs 2002/12/05 19:25:23 1.39 @@ -72,12 +72,12 @@ DOES> ( -- r ) \G floating-point stack. fp0 @ fp@ - [ 1 floats ] Literal / ; -: FLit ( -- r ) r> dup f@ float+ >r ; : FLiteral ( compilation r -- ; run-time -- r ) \ float f-literal \G Compile appropriate code such that, at run-time, @i{r} is placed \G on the (floating-point) stack. Interpretation semantics are undefined. - BEGIN here cell+ dup faligned <> WHILE postpone noop REPEAT - postpone FLit f, ; immediate + BEGIN here cell+ cell+ dup faligned <> WHILE postpone noop REPEAT + postpone ahead here >r f, postpone then + r> postpone literal postpone f@ ; immediate &15 Value precision ( -- u ) \ float-ext \G @i{u} is the number of significant digits currently used by @@ -222,7 +222,7 @@ set-current fnegate f~rel THEN ; -2e 53e f** fconstant fround-offset \ !! does f** work correctly? +1e 53 0 [do] f2* [loop] fconstant fround-offset \ 2^53 : fround ( r1 -- r2 ) \ float f-round \G Round to nearest integral value. Break ties with round-to-even.