diff --git a/prim.cabal b/prim.cabal
--- a/prim.cabal
+++ b/prim.cabal
@@ -1,7 +1,7 @@
 cabal-version: 2.4
 name: prim
 homepage: https://github.com/daig/prim#readme
-version: 0.1.0.8
+version: 0.1.0.9
 category: Prelude
 synopsis: An ergonomic but conservative interface to ghc-prim
 description: 
diff --git a/src/I64.hs b/src/I64.hs
--- a/src/I64.hs
+++ b/src/I64.hs
@@ -1,6 +1,6 @@
 {-# language BangPatterns #-}
 module I64 (I64, module I64) where
-import Stock.B (pattern B#)
+import Stock.B (pattern B#,(&&), pattern I)
 import qualified GHC.Classes as GHC (divInt#,modInt#)
 
 add,sub,mul, quot, rem :: I64 -> I64 -> I64
@@ -44,6 +44,13 @@
 div,mod :: I64 {- ^ divisor -} -> I64 {- ^ dividend -} -> I64 {- ^ modulus -}
 div y x = GHC.divInt# x y; {-# inline div #-}
 mod y x = GHC.modInt# x y; {-# inline mod #-}
+-- | Rounds towards negative infinity. The behavior is undefined if the first argument is zero.
+divMod :: I64 {- ^ divisor -} -> I64 {- ^ dividend -} -> (# I64, I64 #) {- ^ (div, mod) -}
+divMod y x | B# (gt 0# x) && B# (lt 0# y) = case quotRem y (x -# 1# ) of
+                                    (# q, r #) -> (# q -# 1#, r +# y +# 1# #)
+           | B# (lt 0# x) && B# (gt 0# y) = case quotRem y (x +# 1# ) of
+                                    (# q, r #) -> (# q -# 1#, r +# y +# 1# #)
+           | I = quotRem y x
 
 
 addC, subC :: I64 -> I64 -> (# I64, B #)
diff --git a/src/Stock/B.hs b/src/Stock/B.hs
--- a/src/Stock/B.hs
+++ b/src/Stock/B.hs
@@ -13,6 +13,8 @@
 pattern B# :: Prim.B -> B
 pattern B# i <- (Prim.dataToTag# -> i) where B# i = isTrue# i
 
+infixr 3 `and`
+infixr 2 `or`
 and, or :: B -> B -> B
 and = (&&); {-# inline and #-}
 or = (||); {-# inline or #-}
