Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rid of IRandom.NextDouble() method #410

Closed
dahlia opened this issue Aug 7, 2019 · 0 comments

Comments

@dahlia
Copy link
Member

commented Aug 7, 2019

(Reported by @ipdae.)

According to .NET Standard's docs on System.Double:

In addition, the result of arithmetic and assignment operations with Double values may differ slightly by platform because of the loss of precision of the Double type. For example, the result of assigning a literal Double value may differ in the 32-bit and 64-bit versions of the .NET Framework.

Hence it can break determinism of actions when nodes in the network run on different CPU architectures/OSes/.NET runtimes.

Alternatively, we could introduce IRandom.NextDecimal() instead.

@dahlia dahlia added the bug label Aug 7, 2019

dahlia added a commit to dahlia/libplanet that referenced this issue Aug 9, 2019
dahlia added a commit to dahlia/libplanet that referenced this issue Aug 12, 2019
dahlia added a commit to dahlia/libplanet that referenced this issue Aug 13, 2019

@dahlia dahlia closed this in 4e57e89 Aug 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.