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

Re: [Scheme-reports] Padding/placeholders (hashes) in numerical syntax



Peter Bex scripsit:

> How does that work?  AFAIK there's no way to specify how many
> digits of precision you want, using standard procedures at least.

R[23]RS had a bunch of syntactic forms that returned a private
object called a *format* which could be passed as the second
argument to number->string.  For example, on an R3RS system
using 32-bit floats, (number->string 6.0238.10e23 (fix 2))
evaluates to "6023800#################.##".  For details see
http://people.csail.mit.edu/jaffer/r3rs_8.html#SEC51 .

When the system of formats was removed from R4RS and the second 
argument changed to a radix, the # numeric syntax was retained,
presumably so that old data files could still be read.

-- 
LEAR: Dost thou call me fool, boy?      John Cowan
FOOL: All thy other titles              http://www.ccil.org/~cowan
             thou hast given away:      cowan@x
      That thou wast born with.

_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports