Hi Jerzy,

|  > div 1 (-2)
|  -1
|  > div (-1) 2
|  -1
|  
|  but
|  > div (-1) (-2)
|  0
|  > div 1 2
|  0
|  > div 0 (-2)
|  0

No errors here.  Check the Haskell report for properties of div:

  "The quot, rem, div, and mod class methods satisfy these laws: 

      (x `quot` y)*y + (x `rem` y) == x 
      (x `div`  y)*y + (x `mod` y) == x  

   `quot` is integer division truncated toward zero, while the
   result of `div` is truncated toward negative infinity."

Perhaps you were expecting div to be like quot?

All the best,
Mark

_______________________________________________
Hugs-Bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/hugs-bugs

Reply via email to