lists.arthurdejong.org
RSS feed

python-stdnum commit: r97 - python-stdnum/stdnum/iso7064

[Date Prev][Date Next] [Thread Prev][Thread Next]

python-stdnum commit: r97 - python-stdnum/stdnum/iso7064



Author: arthur
Date: Sat Feb  4 20:06:53 2012
New Revision: 97
URL: http://arthurdejong.org/viewvc/python-stdnum?revision=97&view=revision

Log:
use integer division

Modified:
   python-stdnum/stdnum/iso7064/mod_37_36.py

Modified: python-stdnum/stdnum/iso7064/mod_37_36.py
==============================================================================
--- python-stdnum/stdnum/iso7064/mod_37_36.py   Thu Feb  2 22:12:52 2012        
(r96)
+++ python-stdnum/stdnum/iso7064/mod_37_36.py   Sat Feb  4 20:06:53 2012        
(r97)
@@ -43,7 +43,7 @@
 def checksum(number, alphabet='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'):
     """Calculate the checksum."""
     modulus = len(alphabet)
-    check = modulus / 2
+    check = modulus // 2
     for n in number:
         check = (((check or modulus) * 2) % (modulus + 1) + alphabet.index(n)) 
% modulus
     return check
-- 
To unsubscribe send an email to
python-stdnum-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/python-stdnum-commits/