--- a/Random.st Fri Feb 28 14:14:59 2014 +0100
+++ b/Random.st Sat Mar 01 18:56:28 2014 +0100
@@ -334,6 +334,8 @@
nextInt:upperBound
"Answer a random integer in the interval [1, anInteger]."
+ (upperBound < 1) ifTrue:[self error:'invalid upper bound'].
+
^ self nextIntegerBetween:1 and:upperBound
"
@@ -697,10 +699,10 @@
!Random class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic2/Random.st,v 1.48 2014-02-16 00:34:04 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic2/Random.st,v 1.49 2014-03-01 17:56:28 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic2/Random.st,v 1.48 2014-02-16 00:34:04 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic2/Random.st,v 1.49 2014-03-01 17:56:28 cg Exp $'
! !