On 10/19/26 11:03 AM, peter wrote:
> On Mon, 19 Oct 2026 09:51:12 -0500 > Krishna Myneni <kris…@ccreweb.org> wrote: >
...
>> \ Convert r to a scientific notation string, caddr u pair, >> \ with n decimal places >> : (fs.n) ( n -- a u ) ( F: r -- ) \ ( r n -- a u ) >> precision >r 1+ set-precision (fs.) strbufmove >> r> set-precision ; >>
...
>> FS.N where n is decimal places is often what users want. >>
...
> I did it even simpler as I already had a factor for fs. and fe. > > : (FS.) fpad precision 2dup represent 1 (fx.) ; > : (FS.N) fpad swap 1+ 1 max 2dup represent 1 (fx.) ; > : (FE.) fpad precision 3 max 2dup represent 3 (fx.) ; > > no negative n allowed here! >
That's nice and compact.
-- KM