[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [shootout] heapsort.scm



  . . .
> How do control the number of digits of a float to print ?
> I only need 10 digits.

If you use SLIB, you can do either

    (require 'format)
    ...
    (format #t "~15,10F" foo)
or
    (require 'printf)
    ...
    (printf "%#15.10" foo)

to print foo in a 15 char field with 10 decimal places; both functions
round at the last place.

In v200 you have to do
    (require (lib "load.ss" "slibinit"))
before either of the above.  As I understand it from the Help Desk
doc'n for SLIB, this redefines "require" and makes the other libraries
unavailable.  In v103 things work more smoothly, since "require-library"
is unaffected by hooking in SLIB.

 -- Bill Wood