[Haskell-beginners] why doesn't this work?

David McBride toad3k at gmail.com
Thu Jan 9 13:47:07 UTC 2020


Floating point comparisons are a bad idea.

A better way would be x `mod` y == 0.

On Wed, Jan 8, 2020 at 10:01 AM Alexander Chen <alexander at chenjia.nl> wrote:

> hi,
>
> for a List comprehension I want to only include the integers of a
> division. In my beginners mind this should work:
>
> (round (x / y)) == (x / y)
>
> however, i get a nontrivial error blurp.
>
> what am i doing wrong?
>
> best,
>
> Alexander
>
>
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20200109/a089b317/attachment.html>


More information about the Beginners mailing list