diff --git a/Data/Aeson/Encode/Int.hs b/Data/Aeson/Encode/Int.hs
--- a/Data/Aeson/Encode/Int.hs
+++ b/Data/Aeson/Encode/Int.hs
@@ -25,7 +25,7 @@
     | otherwise = go i
   where
     go n | n < 10    = digit n
-         | otherwise = go (n `rem` 10) `mappend` digit (n `quot` 10)
+         | otherwise = go (n `quot` 10) `mappend` digit (n `rem` 10)
 
 digit :: Int -> Builder
 digit n = fromWord8 $! fromIntegral n + 48
diff --git a/aeson.cabal b/aeson.cabal
--- a/aeson.cabal
+++ b/aeson.cabal
@@ -1,5 +1,5 @@
 name:            aeson
-version:         0.3.2.0
+version:         0.3.2.1
 license:         BSD3
 license-file:    LICENSE
 category:        Text, Web, JSON
