Skip to content

Commit 2a793c4

Browse files
authored
Merge pull request #296 from schmouk/release-2-2
#295-fix invalid final values in Cwg128_64
2 parents d803907 + 9cf9cec commit 2a793c4

File tree

14 files changed

+35
-35
lines changed

14 files changed

+35
-35
lines changed

Python3.10/PyRandLib/cwg128_64.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,14 @@ class Cwg128_64( BaseCWG ):
8686

8787

8888
#-------------------------------------------------------------------------
89-
_NORMALIZE: Final[float] = 5.421_010_862_427_522_170_037_3e-20 # i.e. 1.0 / (1 << 64) # type: ignore
89+
_NORMALIZE: Final[float] = 2.938_735_877_055_718_769_921_8e-39 # i.e. 1.0 / (1 << 128) # type: ignore
9090
"""The value of this class attribute MUST BE OVERRIDDEN in inheriting
9191
classes if returned random integer values are coded on anything else
9292
than 32 bits. It is THE multiplier constant value to be applied to
9393
pseudo-random number for them to be normalized in interval [0.0, 1.0).
9494
"""
9595

96-
_OUT_BITS: Final[int] = 64 # type: ignore
96+
_OUT_BITS: Final[int] = 128 # type: ignore
9797
"""The value of this class attribute MUST BE OVERRIDDEN in inheriting
9898
classes if returned random integer values are coded on anything else
9999
than 32 bits.

Python3.10/unit_tests/test_cwg128_64.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ class TestCwg128_64:
3333

3434
#-------------------------------------------------------------------------
3535
def test_class(self):
36-
assert Cwg128_64._NORMALIZE == 1.0 / (1 << 64)
37-
assert Cwg128_64._OUT_BITS == 64
36+
assert Cwg128_64._NORMALIZE == 1.0 / (1 << 128)
37+
assert Cwg128_64._OUT_BITS == 128
3838

3939
#-------------------------------------------------------------------------
4040
def test_init_empty(self):
@@ -153,7 +153,7 @@ def test_next(self):
153153
0x02db_2872_975a_0dc2_ef31_7b6d_bb8b_b2c0,
154154
0xe9ae_0772_75c3_945f_1ede_5352_8e8f_1440,
155155
0xfb7e_4d17_2841_1ef0_adc9_d067_65af_a5ba,
156-
0x0293_03b5_b41b_2417_d6af_a7b4_0ecc_40951
156+
0x2930_3b5b_41b2_417d_6afa_7b40_ecc4_0951
157157
]:
158158
assert cwg.next() == v
159159

Python3.11/PyRandLib/cwg128_64.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,14 @@ class Cwg128_64( BaseCWG ):
8686

8787

8888
#-------------------------------------------------------------------------
89-
_NORMALIZE: Final[float] = 5.421_010_862_427_522_170_037_3e-20 # i.e. 1.0 / (1 << 64) # type: ignore
89+
_NORMALIZE: Final[float] = 2.938_735_877_055_718_769_921_8e-39 # i.e. 1.0 / (1 << 128) # type: ignore
9090
"""The value of this class attribute MUST BE OVERRIDDEN in inheriting
9191
classes if returned random integer values are coded on anything else
9292
than 32 bits. It is THE multiplier constant value to be applied to
9393
pseudo-random number for them to be normalized in interval [0.0, 1.0).
9494
"""
9595

96-
_OUT_BITS: Final[int] = 64 # type: ignore
96+
_OUT_BITS: Final[int] = 128 # type: ignore
9797
"""The value of this class attribute MUST BE OVERRIDDEN in inheriting
9898
classes if returned random integer values are coded on anything else
9999
than 32 bits.

Python3.11/unit_tests/test_cwg128_64.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ class TestCwg128_64:
3333

3434
#-------------------------------------------------------------------------
3535
def test_class(self):
36-
assert Cwg128_64._NORMALIZE == 1.0 / (1 << 64)
37-
assert Cwg128_64._OUT_BITS == 64
36+
assert Cwg128_64._NORMALIZE == 1.0 / (1 << 128)
37+
assert Cwg128_64._OUT_BITS == 128
3838

3939
#-------------------------------------------------------------------------
4040
def test_init_empty(self):
@@ -152,7 +152,7 @@ def test_next(self):
152152
0x02db_2872_975a_0dc2_ef31_7b6d_bb8b_b2c0,
153153
0xe9ae_0772_75c3_945f_1ede_5352_8e8f_1440,
154154
0xfb7e_4d17_2841_1ef0_adc9_d067_65af_a5ba,
155-
0x0293_03b5_b41b_2417_d6af_a7b4_0ecc_40951
155+
0x2930_3b5b_41b2_417d_6afa_7b40_ecc4_0951
156156
]:
157157
assert cwg.next() == v
158158

Python3.12/PyRandLib/cwg128_64.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,14 @@ class Cwg128_64( BaseCWG ):
8686

8787

8888
#-------------------------------------------------------------------------
89-
_NORMALIZE: Final[float] = 5.421_010_862_427_522_170_037_3e-20 # i.e. 1.0 / (1 << 64) # type: ignore
89+
_NORMALIZE: Final[float] = 2.938_735_877_055_718_769_921_8e-39 # i.e. 1.0 / (1 << 128) # type: ignore
9090
"""The value of this class attribute MUST BE OVERRIDDEN in inheriting
9191
classes if returned random integer values are coded on anything else
9292
than 32 bits. It is THE multiplier constant value to be applied to
9393
pseudo-random number for them to be normalized in interval [0.0, 1.0).
9494
"""
9595

96-
_OUT_BITS: Final[int] = 64 # type: ignore
96+
_OUT_BITS: Final[int] = 128 # type: ignore
9797
"""The value of this class attribute MUST BE OVERRIDDEN in inheriting
9898
classes if returned random integer values are coded on anything else
9999
than 32 bits.

Python3.12/unit_tests/test_cwg128_64.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ class TestCwg128_64:
3333

3434
#-------------------------------------------------------------------------
3535
def test_class(self):
36-
assert Cwg128_64._NORMALIZE == 1.0 / (1 << 64)
37-
assert Cwg128_64._OUT_BITS == 64
36+
assert Cwg128_64._NORMALIZE == 1.0 / (1 << 128)
37+
assert Cwg128_64._OUT_BITS == 128
3838

3939
#-------------------------------------------------------------------------
4040
def test_init_empty(self):
@@ -152,7 +152,7 @@ def test_next(self):
152152
0x02db_2872_975a_0dc2_ef31_7b6d_bb8b_b2c0,
153153
0xe9ae_0772_75c3_945f_1ede_5352_8e8f_1440,
154154
0xfb7e_4d17_2841_1ef0_adc9_d067_65af_a5ba,
155-
0x0293_03b5_b41b_2417_d6af_a7b4_0ecc_40951
155+
0x2930_3b5b_41b2_417d_6afa_7b40_ecc4_0951
156156
]:
157157
assert cwg.next() == v
158158

Python3.13/PyRandLib/cwg128_64.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,14 @@ class Cwg128_64( BaseCWG ):
8686

8787

8888
#-------------------------------------------------------------------------
89-
_NORMALIZE: Final[float] = 5.421_010_862_427_522_170_037_3e-20 # i.e. 1.0 / (1 << 64) # type: ignore
89+
_NORMALIZE: Final[float] = 2.938_735_877_055_718_769_921_8e-39 # i.e. 1.0 / (1 << 128) # type: ignore
9090
"""The value of this class attribute MUST BE OVERRIDDEN in inheriting
9191
classes if returned random integer values are coded on anything else
9292
than 32 bits. It is THE multiplier constant value to be applied to
9393
pseudo-random number for them to be normalized in interval [0.0, 1.0).
9494
"""
9595

96-
_OUT_BITS: Final[int] = 64 # type: ignore
96+
_OUT_BITS: Final[int] = 128 # type: ignore
9797
"""The value of this class attribute MUST BE OVERRIDDEN in inheriting
9898
classes if returned random integer values are coded on anything else
9999
than 32 bits.

Python3.13/unit_tests/test_cwg128_64.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ class TestCwg128_64:
3333

3434
#-------------------------------------------------------------------------
3535
def test_class(self):
36-
assert Cwg128_64._NORMALIZE == 1.0 / (1 << 64)
37-
assert Cwg128_64._OUT_BITS == 64
36+
assert Cwg128_64._NORMALIZE == 1.0 / (1 << 128)
37+
assert Cwg128_64._OUT_BITS == 128
3838

3939
#-------------------------------------------------------------------------
4040
def test_init_empty(self):
@@ -152,7 +152,7 @@ def test_next(self):
152152
0x02db_2872_975a_0dc2_ef31_7b6d_bb8b_b2c0,
153153
0xe9ae_0772_75c3_945f_1ede_5352_8e8f_1440,
154154
0xfb7e_4d17_2841_1ef0_adc9_d067_65af_a5ba,
155-
0x0293_03b5_b41b_2417_d6af_a7b4_0ecc_40951
155+
0x2930_3b5b_41b2_417d_6afa_7b40_ecc4_0951
156156
]:
157157
assert cwg.next() == v
158158

Python3.14/PyRandLib/cwg128_64.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,14 @@ class Cwg128_64( BaseCWG ):
8686

8787

8888
#-------------------------------------------------------------------------
89-
_NORMALIZE: Final[float] = 5.421_010_862_427_522_170_037_3e-20 # i.e. 1.0 / (1 << 64) # type: ignore
89+
_NORMALIZE: Final[float] = 2.938_735_877_055_718_769_921_8e-39 # i.e. 1.0 / (1 << 128) # type: ignore
9090
"""The value of this class attribute MUST BE OVERRIDDEN in inheriting
9191
classes if returned random integer values are coded on anything else
9292
than 32 bits. It is THE multiplier constant value to be applied to
9393
pseudo-random number for them to be normalized in interval [0.0, 1.0).
9494
"""
9595

96-
_OUT_BITS: Final[int] = 64 # type: ignore
96+
_OUT_BITS: Final[int] = 128 # type: ignore
9797
"""The value of this class attribute MUST BE OVERRIDDEN in inheriting
9898
classes if returned random integer values are coded on anything else
9999
than 32 bits.

Python3.14/unit_tests/test_cwg128_64.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ class TestCwg128_64:
3333

3434
#-------------------------------------------------------------------------
3535
def test_class(self):
36-
assert Cwg128_64._NORMALIZE == 1.0 / (1 << 64)
37-
assert Cwg128_64._OUT_BITS == 64
36+
assert Cwg128_64._NORMALIZE == 1.0 / (1 << 128)
37+
assert Cwg128_64._OUT_BITS == 128
3838

3939
#-------------------------------------------------------------------------
4040
def test_init_empty(self):
@@ -152,7 +152,7 @@ def test_next(self):
152152
0x02db_2872_975a_0dc2_ef31_7b6d_bb8b_b2c0,
153153
0xe9ae_0772_75c3_945f_1ede_5352_8e8f_1440,
154154
0xfb7e_4d17_2841_1ef0_adc9_d067_65af_a5ba,
155-
0x0293_03b5_b41b_2417_d6af_a7b4_0ecc_40951
155+
0x2930_3b5b_41b2_417d_6afa_7b40_ecc4_0951
156156
]:
157157
assert cwg.next() == v
158158

0 commit comments

Comments
 (0)