Re: -0.0 on gauche; max-int
Antero Mejr 14 Feb 2024 02:48 UTC
> On 02/14/2024 2:36 AM GMT Bradley Lucier <xxxxxx@purdue.edu> wrote:
>
>
> On 2/13/24 9:05 PM, Bradley Lucier wrote:
> >
> > 2. The SRFI 27 random number generator generates a range of integers
> > between 0 and a bit under 2^{32}. To generate numbers greater than this
> > requires several calls to the basic generator, using arithmetic shifts
> > to assemble the random integer from random "words" of size a bit smaller
> > than 32 bits.
> >
> > So on a 64-bit machine, fx-greatest is going probably going to have a
> > width a bit less than 64-bits, so the default random integer will take
> > 2-3 calls to SRFI 27's basic random number generator for each random
> > fixnum generated.
> >
> > If we're going to stick with generating fixnums with these integer
> > generators, then I think it would be good to have a max-int width that
> > takes only one call to the SRFI 27 generator. So that would require a
> > max-int of around 2^{28} or less.
> >
> > (snipped)
Is the intention to minimize the number of calls for performance reasons? If so,
shouldn't that be left up to the implementation?
When running the 2822 tests on Gauche, most of the time is spent writing the test
log, not generating test inputs. So by default, I think it would be safer to
generate the full range of fixnums despite the small performance hit.