[r6rs-discuss] Hashes in the number syntax

dyb at cs.indiana.edu dyb at cs.indiana.edu
Sun Nov 19 17:17:55 EST 2006


The floating-point printing algorithm described in "Printing
floating-point numbers quickly and accurately" (Burger/Dybvig PLDI '96)
uses hash digits to indicate less than the requested amount of precision. 
This algorithm is used by Chez Scheme's implementation of format, so that,
for example:

  (format "~,20f" 1.0) ;=> "1.0000000000000000####"
  (format "~,5e" 5e-324) ;=> "5.#####e-324"          ; denormalized value

So while I agree that the hash digits are not particularly useful for
data-entry input, they are useful for output.  Furthermore, if the output
routines can produce hash digits, it's also useful for the reader to
accept them.

Kent



More information about the r6rs-discuss mailing list