
20 Dec
2005
20 Dec
'05
2:14 p.m.
From: Daniel Carrera
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