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

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



On Mon, Sep 05, 2011 at 01:54:12PM -0400, Aubrey Jaffer wrote:
>  | Date: Mon, 5 Sep 2011 18:57:16 +0200
>  | From: Peter Bex <Peter.Bex@x>
>  | 
>  | On Sun, Sep 04, 2011 at 09:12:42PM -0400, Aubrey Jaffer wrote:
>  | > I believe that R5RS permits engineering-notation.
>  | 
>  | Absolutely; I was wondering how it decides to print 3/4 as 750.0e-3
>  | considering 7.5e-1 is equally acceptable, as is 0.75 or 75e-2 or
>  | any other exponent prefixed by a suitably scaled number.
> 
> In engineering-notation the exponent is always an integer multiple of
> 3.  SCM scales the matissa to be between 1 and 1000, and omits the
> exponent when it is 0.

I see.  I've now added support for this kind of notation to the tests,
and I've also added a mode in which it accepts fractional numbers being
parsed into flonums, like the version of SCM which I have (a horribly
outdated version 5e3) seems to do.  Chicken without the "numbers" egg
does this as well.

Most failing tests in SCM are about NaN/Inf syntax and padding now;
27 errors with 5e3.  I'm sure the newer version has less errors.

Cheers,
Peter
-- 
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
							-- Donald Knuth

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