munkres
munkres copied to clipboard
test_profit_float fails on 32bit systems
d9fefe31cee6271ee5cf75c1a2ead0b352e081dd introduced test_profit_float, which passes on 64bit platforms, but not 32bit. At least in my testing on i386 and Debian armhf:
======================================================================
FAIL: test.test_munkres.test_profit_float
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/stefanor/git/munkres/test/test_munkres.py", line 171, in test_profit_float
assert_almost_equal(profit, 362.65)
AssertionError: 392.65000000000003 != 362.65 within 7 places (30.000000000000057 difference)
Presumably this is due to using sys.maxize in the calculation, a carry-over from the integer test_profit.
float is the same size on 32 & 64 bit platforms, but sys.maxsize will differ by many orders of magnitude, causing a loss of precision of the result on 64bit.
I also have the same problem when compiling on EeePC 1001HA (32bit)

Same error for armv7l