#NEWLINE# def test_double_compatibility( ) : #NEWLINE# #INDENT# mp . prec = 53 #NEWLINE# for ( x , y ) in zip ( xs , ys ) : #NEWLINE# #INDENT# mpx = mpf ( x ) #NEWLINE# mpy = mpf ( y ) #NEWLINE# assert ( mpf ( x ) == x ) #NEWLINE# assert ( ( mpx < mpy ) == ( x < y ) ) #NEWLINE# assert ( ( mpx > mpy ) == ( x > y ) ) #NEWLINE# assert ( ( mpx == mpy ) == ( x == y ) ) #NEWLINE# assert ( ( mpx != mpy ) == ( x != y ) ) #NEWLINE# assert ( ( mpx <= mpy ) == ( x <= y ) ) #NEWLINE# assert ( ( mpx >= mpy ) == ( x >= y ) ) #NEWLINE# assert ( mpx == mpx ) #NEWLINE# if uses_x87 : #NEWLINE# #INDENT# mp . prec = 64 #NEWLINE# a = ( mpx + mpy ) #NEWLINE# b = ( mpx * mpy ) #NEWLINE# c = ( mpx / mpy ) #NEWLINE# d = ( mpx % mpy ) #NEWLINE# mp . prec = 53 #NEWLINE# assert ( ( + a ) == ( x + y ) ) #NEWLINE# assert ( ( + b ) == ( x * y ) ) #NEWLINE# assert ( ( + d ) == ( x / y ) ) #NEWLINE# assert ( ( + d ) == ( x % y ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# assert ( ( mpx + mpy ) == ( x + y ) ) #NEWLINE# assert ( ( mpx * mpy ) == ( x * y ) ) #NEWLINE# assert ( ( mpx / mpy ) == ( x / y ) ) #NEWLINE# assert ( ( mpx % mpy ) == ( x % y ) ) #NEWLINE# #UNINDENT# assert ( abs ( mpx ) == abs ( x ) ) #NEWLINE# assert ( mpf ( repr ( x ) ) == x ) #NEWLINE# assert ( ceil ( mpx ) == math . ceil ( x ) ) #NEWLINE# assert ( floor ( mpx ) == math . floor ( x ) )