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

# in place of a digit.

   From: David Carlton <carlton@math.mit.edu>
   Date: Mon, 5 Dec 94 12:43:53 EST

   On Mon, 5 Dec 94 12:24:57 -0500, Gerald Jay Sussman <gjs@martigny.ai.mit.edu> said:

   > The idea was that one might print a number with an output format
   > that produces more digits than are available in the internal machine
   > representation of the number.  The idea is that such a format would
   > fill out the printed representation of the number with "#"s rather
   > than filling it out with useless (and misleadingly precise) digits.

   I'm somewhat confused by this.  The R4RS description of number->string
   says that it should produce a result with the minimum possible number
   of digits; so in that case, the last one (at worst) would be
   misleadingly precise, and it would have to be in there anyways, so
   that (string->number (number->string x)) was equal to x.  I know that
   those guarantees (or at least the first one) are a R4RS innovation;
   was # a pre-R4RS way of allowing number->string do a poorer version of

No, this had to do with the R3RS formatted output feature, which was
dropped in R4RS.  The formatted output could specify the number of
digits of precision (like FORTRAN), in which case you could specify
more digits than were actually there.

Although the formatted output feature is gone, this is still useful
because a given implementation could implement a similar feature, in
which case it's nice to have a readable representation available.