Can anybody explain what appear to be discrepancies in the way the following expressions are interpreted by Hugs (Haskell98 mode) ?(adsbygoogle = window.adsbygoogle || []).push({});

Code (Text):

Main> div -6 4

ERROR - Cannot infer instance

*** Instance : Num (b -> a -> a -> a)

*** Expression : div - fromInt 6 4

Main> div (-6) 4

-2

Main> -6 `div` 4

-1

Main> (-6) `div` 4

-2

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Integer arithmetic in Haskell

Loading...

Similar Threads - Integer arithmetic Haskell | Date |
---|---|

Integer Partition Calculator | Aug 5, 2013 |

C++ conversion of integers into strings, how | Oct 25, 2006 |

**Physics Forums - The Fusion of Science and Community**