forked from djuber/SciSmalltalk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
modified Random and Tests. New Configuration made.
- Loading branch information
Showing
33 changed files
with
110 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
Math-RandomTests.package/BernoulliGeneratorTest.class/instance/testNext.st
This file was deleted.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
Math-RandomTests.package/BernoulliGeneratorTest.class/instance/testProbabilityIsMutable.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
tests-accessing | ||
testProbabilityIsMutable | ||
| g | | ||
g := BernoulliGenerator withProbability: 0.0. | ||
self should: [g next = 0]. | ||
self should: [g p = 0]. | ||
g p: 1. | ||
self should: [g next = 1]. | ||
self should: [g p = 1]. |
9 changes: 9 additions & 0 deletions
9
...ndomTests.package/MersenneTwisterRandomTest.class/instance/testNext10BetweenZeroAndTen.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
tests | ||
testNext10BetweenZeroAndTen | ||
| g | | ||
g := MersenneTwisterRandom new. | ||
1000 timesRepeat: | ||
[ | value | | ||
value := g next. | ||
self should: [value > 0]. | ||
self should: [value < 10]]. |
15 changes: 15 additions & 0 deletions
15
...RandomTests.package/MersenneTwisterRandomTest.class/instance/testNextFloatExcludeUpper.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
tests | ||
testNextFloatExcludeUpper | ||
"this revealed a bug in early versions, excludeUpper was producing between 0 and 2" | ||
| g sample1 sample2 | | ||
g := MersenneTwisterRandom new. | ||
sample1 := Array new: 10000. | ||
sample2 := Array new: 10000. | ||
1 to: 10000 do: | ||
[:i | | ||
sample1 at: i put: g nextFloatExcludeUpper. | ||
sample2 at: i put: (g nextFloatExcludeUpper: 2)]. | ||
self should: [sample1 max < 1]. | ||
self shouldnt: [sample1 max < 0.8]. | ||
self should: [sample2 max < 2]. | ||
self shouldnt: [sample2 max < 1.6]. |
5 changes: 0 additions & 5 deletions
5
...Tests.package/MersenneTwisterRandomTest.class/instance/testPeekAlwaysReplyTheSameValue.st
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
...RandomTests.package/MersenneTwisterRandomTest.class/instance/testPeekAnswersSameAsNext.st
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.