"Fossies" - the Fresh Open Source Software Archive  

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

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

test_bitwise.py  (mpmath-0.19):test_bitwise.py  (mpmath-1.0.0)
skipping to change at line 173 skipping to change at line 173
assert (x-c) == -c assert (x-c) == -c
assert (x-d) == x assert (x-d) == x
assert (x-e) == x assert (x-e) == x
assert (x-f) == x assert (x-f) == x
assert (a-x) == a assert (a-x) == a
assert (b-x) == b assert (b-x) == b
assert (c-x) == c assert (c-x) == c
assert (d-x) == -x assert (d-x) == -x
assert (e-x) == -x assert (e-x) == -x
assert (f-x) == -x assert (f-x) == -x
def test_float_rounding():
mp.prec = 64
for x in [mpf(1), mpf(1)+eps, mpf(1)-eps, -mpf(1)+eps, -mpf(1)-eps]:
fa = float(x)
fb = float(fadd(x,0,prec=53,rounding='n'))
assert fa == fb
z = mpc(x,x)
ca = complex(z)
cb = complex(fadd(z,0,prec=53,rounding='n'))
assert ca == cb
for rnd in ['n', 'd', 'u', 'f', 'c']:
fa = to_float(x._mpf_, rnd=rnd)
fb = to_float(fadd(x,0,prec=53,rounding=rnd)._mpf_, rnd=rnd)
assert fa == fb
mp.prec = 53
 End of changes. 1 change blocks. 
0 lines changed or deleted 0 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)