I would rather prefer an implemenation returning answers as precise
as possible by default, and having an option to trade precision
for speed when necessary.   That is, implicit fixnum to bignum coercion
by default, and some option that switches the mode to fixnum to flonum
coercion.  Same as exact rationals.

--shiro



From: Ray Dillinger <[email protected]>
Subject: Re: [r6rs-discuss] The numeric tower
Date: Wed, 23 Sep 2009 10:24:28 -0700

> On Tue, 2009-09-22 at 21:15 -0700, Brian Harvey wrote:
> > > Honestly, I think most of the practical problems with bignums would be 
> > > solved if there were no automatic coercion between 'big' and
> > > 'fixed-size' numeric representations.
> > 
> > This would be okay with me as long as we redefine "fixnum" to mean "numbers
> > whose magnitude is less than or equal to 100 factorial."  :-)  I would 
> > really
> > hate to lose that demo in lecture.
> 
> Would you be unhappy if there were a distinguished syntax for "bignum"
> values in the fixnum range, where fixnums overflow to inexact and
> bignums yield bignum results?  For example if 
> 
> ;; overflow to inexact for a non-bignum 100
> (exponential 100) ==> 9.332621544394415268169923885626670049E157 
> 
> ;; require a bignum result for a bignum 100 (using #L for "large" 
> ;; as a bignum prefix because #b is taken for binary...)
> (exponential +#L100) ==>
> 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000
> 
> Because this is what I actually want, especially for ratios.  
> Alternatively, 157 decimal digits ~= 240 bits
> 
>                       Bear
> 
> 
> 
> _______________________________________________
> r6rs-discuss mailing list
> [email protected]
> http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss



_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

Reply via email to