-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: increase the possible random numbers used for stickiness id (#241)
This update changes how we calculate random percentages in the SDK. Instead of multiplying a random int with 100 (which absolutely could cause overflows), we now use a ranged `Next` call, to generate one of 10k different numbers. This is in line with how we get the random number in other sdks. I've added a test to ensure that random distribution works to within the accepted deviation.
- Loading branch information
1 parent
07578e6
commit f682075
Showing
2 changed files
with
39 additions
and
1 deletion.
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