Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
5693-Fix-generator-state-mask-bug.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 5693-Fix-generator-state-mask-bug.patch of Package erlang
From 1b03fcb9599c29bb22340e2bb729746af853bb7d Mon Sep 17 00:00:00 2001 From: Raimo Niskanen <raimo@erlang.org> Date: Mon, 2 May 2022 17:11:44 +0200 Subject: [PATCH 3/6] Fix generator state mask bug --- lib/stdlib/src/rand.erl | 2 +- lib/stdlib/test/rand_SUITE.erl | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/stdlib/src/rand.erl b/lib/stdlib/src/rand.erl index 217b1d14b5..5f94804bfb 100644 --- a/lib/stdlib/src/rand.erl +++ b/lib/stdlib/src/rand.erl @@ -1511,7 +1511,7 @@ dummy_seed({A1, A2, A3}) -> -spec mwc59(CX0 :: mwc59_state()) -> CX1 :: mwc59_state(). mwc59(CX0) -> % when is_integer(CX0), 1 =< CX0, CX0 < ?MWC59_P -> - CX = ?MASK(58, CX0), + CX = ?MASK(59, CX0), C = CX bsr ?MWC59_B, X = ?MASK(?MWC59_B, CX), ?MWC59_A * X + C. diff --git a/lib/stdlib/test/rand_SUITE.erl b/lib/stdlib/test/rand_SUITE.erl index 54363b2761..90ea2890e8 100644 --- a/lib/stdlib/test/rand_SUITE.erl +++ b/lib/stdlib/test/rand_SUITE.erl @@ -214,13 +214,13 @@ mwc59_api(Config) when is_list(Config) -> mwc59_api(1, 1000000). mwc59_api(CX0, 0) -> - CX = 187860517065527182, + CX = 298134347579367847, {CX, CX} = {CX0, CX}, V0 = rand:mwc59_value(CX0), - V = 230807595801982862, + V = 44296811804442023, {V, V} = {V0, V}, W0 = rand:mwc59_full_value(CX0), - W = 202476383090409870, + W = 43477957222139559, {W, W} = {W0, W}, F0 = rand:mwc59_float(CX0), F = (W band ((1 bsl 53) - 1)) * (1 / (1 bsl 53)), @@ -1165,7 +1165,7 @@ do_measure(Iterations) -> end end end, - {exsp,next}, Iterations, + {exsp,mod}, Iterations, TMarkUniformRange10000, OverheadUniformRange1000), _ = measure_1( -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor