From 2f44c8984d761079c13e75c81baf45a43fc24d4f Mon Sep 17 00:00:00 2001 From: Von Random Date: Sun, 13 Mar 2016 02:36:20 +0300 Subject: [PATCH] replace some insane maths with math that makes sense --- int-to-ip4.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/int-to-ip4.py b/int-to-ip4.py index dd91b4c..52dbeab 100755 --- a/int-to-ip4.py +++ b/int-to-ip4.py @@ -9,6 +9,6 @@ for e in range(3, -1, -1): multiplier = 256 ** e octet = num // multiplier addr.append(str(octet)) - num -= octet * multiplier + num = num % multiplier print('.'.join(addr))