21 Dec
2005
21 Dec
'05
3:14 a.m.
From: Daniel Carrera <daniel.carrera@zmsl.com> Robert Dockins wrote:
-divides a b = (mod a b == 0) +divides a b = (mod b a == 0)
Oh, thanks. My program assumed one way to define 'divides' and the example assumed the other.
When I wrote it I was thinking of (divides a) being a function that tells me if the input divides 'a'.
Thanks!
Cheers, Daniel.
Daniel, Have you used Haskell's infix notation? It can help keep the order straight for operators like these. You can write a `mod` b -- instead of mod a b a `divides` b -- instead of divides a b. This can help with readability, too. Chad Scherrer