Re: Implementation of make-random-real-generator
Marc Nieper-WiÃkirchen 05 May 2020 21:07 UTC
Am Di., 5. Mai 2020 um 23:01 Uhr schrieb John Cowan <xxxxxx@ccil.org>:
>
> But you can reject a and b at the last moment, at the expense of two more conditional branches.
>
> Is it possible to generate a value less than a or greater than b due to rounding? If so, such a last-minute test is outright necessary.
>
> I'll leave it up to you mathematicians to decide which you want.
A Scheme system is not forced to use the IEEE 754 model internally, so
we shouldn't rely on inexact reals behaving in a special way.
If we are true to the spirit of section 6.2 of the R7RS, the question
of whether the boundaries are inclusive or exclusive does not make
much sense. It would make sense if *exact* real numbers were returned.
Thus I would, in principle, follow Shiro's suggestion, namely to leave
the boundary case unspecified.