-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
type: bugSomething that should function correctly isn't.Something that should function correctly isn't.type: enhancementA new feature or addition.A new feature or addition.
Description
I came across this while trying to port this library to another language:
mkSeed
-
To me it looks like
ensureBetweenassumesmodbehaves likeremainder/%. Ifmodis used, the extra check in the if condition seems to be redundant. -
Does it take
mininto account? -
It seems to not include
maxin the range
As we know seedMax and seedMin are positve, maybe something simpler would work:
seedMin + (mod n (seedMax - seedMin))
(and this would still not include the seedMax, maybe define seedMax = lcgM instead)
lcgPerturb
it produces invalid seeds when a negative value is passed as a first argument. I think changing remainder/% to mod may fix this.
Hope this is helpful, don't have the time to provide more accurate test examples.
Metadata
Metadata
Assignees
Labels
type: bugSomething that should function correctly isn't.Something that should function correctly isn't.type: enhancementA new feature or addition.A new feature or addition.