[squeak-dev] The Trunk: Kernel-bf.899.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Feb 10 15:37:28 UTC 2015


Bert Freudenberg uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-bf.899.mcz

==================== Summary ====================

Name: Kernel-bf.899
Author: bf
Time: 10 February 2015, 4:37:05.988 pm
UUID: 1cc7d0c6-0a3d-457f-9609-fa508d11310e
Ancestors: Kernel-eem.898

Fix random for Really Large Integers.

=============== Diff against Kernel-eem.898 ===============

Item was changed:
  ----- Method: Random>>nextInt: (in category 'accessing') -----
  nextInt: anInteger
  	" Answer a random integer in the interval [1, anInteger]. anInteger should be less than 16r80000000. "
  
  	anInteger strictlyPositive ifFalse: [ self error: 'Range must be positive' ].
+ 	"avoid Float arithmetic in #next to work with LargeInts"
+ 	^ ((seed := self nextValue) asInteger * anInteger // M asInteger) + 1!
- 	^ (self next * anInteger) truncated + 1!



More information about the Squeak-dev mailing list