Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Haskell: div vs /


Both /, div are used to perform Division. Only difference is / performs floating-point division only, for integers division we can use div.

*Main> 10 / 9
1.1111111111111112
*Main>
*Main> div 10 9
1
*Main> 10 `div` 9
1


You can use ‘/’ in prefix notation also by using parenthesis.
*Main> (/) 10 9
1.1111111111111112



Previous                                                 Next                                                 Home


This post first appeared on Java Tutorial : Blog To Learn Java Programming, please read the originial post: here

Share the post

Haskell: div vs /

×

Subscribe to Java Tutorial : Blog To Learn Java Programming

Get updates delivered right to your inbox!

Thank you for your subscription

×