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() #419

Merged
merged 2 commits into from
Aug 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ To be released.
became to `Int64` type. [[#396], [#399]]
- Added `IStore.GetCanonicalNamespace()` method. [[#426]]
- Added `IStore.SetCanonicalNamespace()` method. [[#426]]
- Removed `IRandom.NextDouble()` method, because [floating-point arithmetics,
which is underspecified, likely introduce
indeterminism][floating-point determinism]. [[#410], [#419]]

### Added interfaces

Expand Down Expand Up @@ -123,15 +126,18 @@ To be released.
[#398]: https://github.com/planetarium/libplanet/pull/398
[#399]: https://github.com/planetarium/libplanet/pull/399
[#400]: https://github.com/planetarium/libplanet/pull/400
[#410]: https://github.com/planetarium/libplanet/issues/410
[#413]: https://github.com/planetarium/libplanet/pull/413
[#414]: https://github.com/planetarium/libplanet/pull/414
[#416]: https://github.com/planetarium/libplanet/pull/416
[#417]: https://github.com/planetarium/libplanet/pull/417
[#418]: https://github.com/planetarium/libplanet/pull/418
[#419]: https://github.com/planetarium/libplanet/pull/419
[#423]: https://github.com/planetarium/libplanet/pull/423
[#424]: https://github.com/planetarium/libplanet/pull/424
[#426]: https://github.com/planetarium/libplanet/pull/426
[LiteDB #1268]: https://github.com/mbdavid/LiteDB/issues/1268
[floating-point determinism]: https://wp.me/p1fTCO-kT


Version 0.4.1
Expand Down
7 changes: 7 additions & 0 deletions Libplanet/Action/IAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,13 @@ public interface IAction
/// or networking. These bring an action indeterministic. You maybe
/// fine to log messages for debugging purpose, but equivalent messages
/// could be logged multiple times.</para>
/// <para>Lastly, although it might be surprising, <a
/// href="https://wp.me/p1fTCO-kT">floating-point arithmetics are
/// underspecified so that it can make different results on different
/// machines, platforms, runtimes, compilers, and builds</a>.</para>
/// <para>For more on determinism in general, please read also <a
/// href="https://tendermint.com/docs/spec/abci/abci.html#determinism"
/// >Tendermint ABCI's docs on determinism</a>.</para>
/// </remarks>
/// <seealso cref="IActionContext"/>
IAccountStateDelta Execute(IActionContext context);
Expand Down
9 changes: 0 additions & 9 deletions Libplanet/Action/IRandom.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,5 @@ public interface IRandom
/// name="buffer"/> is <c>null</c>.</exception>
/// <seealso cref="System.Random.NextBytes(byte[])"/>
void NextBytes(byte[] buffer);

/// <summary>
/// Gets a random floating-point number that is greater than or
/// equal to 0.0, and less than 1.0.
/// </summary>
/// <returns>A double-precision floating point number that is greater
/// than or equal to 0.0, and less than 1.0.</returns>
/// <seealso cref="System.Random.NextDouble()"/>
double NextDouble();
}
}