"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "mpmath/tests/test_bitwise.py" between
mpmath-0.18.tar.gz and mpmath-0.19.tar.gz

About: mpmath is a Python library for arbitrary-precision floating-point arithmetic.

test_bitwise.py  (mpmath-0.18):test_bitwise.py  (mpmath-0.19)
skipping to change at line 85 skipping to change at line 85
def test_rounding_bugs(): def test_rounding_bugs():
# 1 less than power-of-two cases # 1 less than power-of-two cases
assert from_man_exp(72057594037927935, -56, 53, round_up) == (0, 1, 0, 1) assert from_man_exp(72057594037927935, -56, 53, round_up) == (0, 1, 0, 1)
assert from_man_exp(73786976294838205979, -65, 53, round_nearest) == (0, 1, 1, 1) assert from_man_exp(73786976294838205979, -65, 53, round_nearest) == (0, 1, 1, 1)
assert from_man_exp(31, 0, 4, round_up) == (0, 1, 5, 1) assert from_man_exp(31, 0, 4, round_up) == (0, 1, 5, 1)
assert from_man_exp(-31, 0, 4, round_floor) == (1, 1, 5, 1) assert from_man_exp(-31, 0, 4, round_floor) == (1, 1, 5, 1)
assert from_man_exp(255, 0, 7, round_up) == (0, 1, 8, 1) assert from_man_exp(255, 0, 7, round_up) == (0, 1, 8, 1)
assert from_man_exp(-255, 0, 7, round_floor) == (1, 1, 8, 1) assert from_man_exp(-255, 0, 7, round_floor) == (1, 1, 8, 1)
def test_rounding_issue160(): def test_rounding_issue_200():
a = from_man_exp(9867,-100) a = from_man_exp(9867,-100)
b = from_man_exp(9867,-200) b = from_man_exp(9867,-200)
c = from_man_exp(-1,0) c = from_man_exp(-1,0)
z = (1, 1023, -10, 10) z = (1, 1023, -10, 10)
assert mpf_add(a, c, 10, 'd') == z assert mpf_add(a, c, 10, 'd') == z
assert mpf_add(b, c, 10, 'd') == z assert mpf_add(b, c, 10, 'd') == z
assert mpf_add(c, a, 10, 'd') == z assert mpf_add(c, a, 10, 'd') == z
assert mpf_add(c, b, 10, 'd') == z assert mpf_add(c, b, 10, 'd') == z
def test_perturb(): def test_perturb():
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS