[Haskell-beginners] Mixed division

Lawrence Bottorff borgauf at gmail.com
Fri Feb 5 18:22:52 UTC 2021


I can divide a float by an integer

>  2.4 / 3
0.7999999999999999

but why can I not do this?

< 2.4 / (length [1,2,3])
<interactive>:288:1-22: error:
    * No instance for (Fractional Int) arising from a use of `/'
    * In the expression: 2.4 / (length [1, 2, 3])

LB
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20210205/ad817bbb/attachment.html>


More information about the Beginners mailing list