Re: arithmetic issues William D Clinger (19 Jan 2006 05:58 UTC)
Re: arithmetic issues Paul Schlie (20 Jan 2006 21:43 UTC)
Re: arithmetic issues Marcin 'Qrczak' Kowalczyk (20 Jan 2006 23:19 UTC)
Re: arithmetic issues Paul Schlie (21 Jan 2006 02:17 UTC)
Re: arithmetic issues Marcin 'Qrczak' Kowalczyk (21 Jan 2006 10:51 UTC)
Re: arithmetic issues Paul Schlie (21 Jan 2006 15:56 UTC)
Re: arithmetic issues Michael Sperber (21 Jan 2006 10:52 UTC)

Re: arithmetic issues Marcin 'Qrczak' Kowalczyk 21 Jan 2006 10:50 UTC

Paul Schlie <xxxxxx@comcast.net> writes:

>> My toy Scheme interpreter is hosted by a language with native bignums,
>> and no distinction between fixnums and bignums in the public API.
>> A requirement to support modular arithmetic would be inconvenient here.
>
> - then (integer-range) for your implementation would be fairly large, and
>   no ambiguity exists unless the maximum bignum value is overflowed.

integer-range is not feasible because in the current implementation
for most machines the memory for representing the maximum overflows
earlier than the theoretical limit of the representation. The actual
range is not well defined for this reason.

Arithmetic is definitely not modular wrt. this range. Overflow of
bignums should generate exceptions, but since it's unimplementable
with my choice of the bignum library (GMP), the current implementation
crashes. This is a known bug which won't be fixed in the foreseeable
future.

--
   __("<         Marcin Kowalczyk
   \__/       xxxxxx@knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/