From: Michael Orlitzky Date: Sun, 9 May 2010 19:34:33 +0000 (-0400) Subject: Fixed the value of (octet_from_int 128). X-Git-Tag: 0.0.1~53 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=d74254fd2a30214d7a8e4b9c407a6ec4fd6fed7f;p=hath.git Fixed the value of (octet_from_int 128). --- diff --git a/src/Octet.hs b/src/Octet.hs index bdada65..e2e01ea 100644 --- a/src/Octet.hs +++ b/src/Octet.hs @@ -42,7 +42,7 @@ octet_from_int x | (x < 0) || (x > 255) = Octet.None | otherwise = (Octet a1 a2 a3 a4 a5 a6 a7 a8) where - a1 = if (x > 128) then One else Zero + a1 = if (x >= 128) then One else Zero a2 = if ((x `mod` 128) >= 64) then One else Zero a3 = if ((x `mod` 64) >= 32) then One else Zero a4 = if ((x `mod` 32) >= 16) then One else Zero