[Pharo-dev] atRandom & integer agnosticism
david.i.richards.iii at gmail.com
Mon Feb 11 01:58:58 EST 2019
| n i r |
n := ( 2 ** 256 ) - 1 . "the largest 256-bit value"
i := ( 0 to: n ) . "the interval 0 to 2**256-1"
"Produce three sets of computed test results."
3 timesRepeat: [
Transcript show: ( r := i atRandom ) ; cr .
Transcript show: ( r asByteArray hex ) ; cr . ]
According to comments in Pharo library code, atRandom fails for integer
magnitudes greater than 2**30 . A reason for this limitation is not given,
and it's not clear to a novice such as myself why the computed result of
atRandom is permitted to sometimes be in conflict with the semantics of
Can anyone provide a basic explanation of the rationale for a 'broken'
Alternatively, is this a known bug?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pharo-dev