[Haskell] (no subject)

Chris Mears chris at cmears.id.au
Wed Sep 5 17:39:29 EDT 2007


"Tomi Owens" <t.owens at hautlieu.sch.je> writes:

> Hi there. I'm a teacher of Maths and am working my way through the
> Euler Project problems for fun. I have mostly been using Basic, but
> have read up about Haskell and think it looks like a sensible way to
> solve many of the problems.

It certainly is.

> Prelude> let f (a,b) = a * floor (100000/b)

>From the floor and the rest of your message, it looks like you want
truncating integer division here.  So, instead of floor and (/), use
div.

    let f (a,b) = a * 100000 `div` b

With that change the rest of your program should work.

The other replies explain why the interpreter couldn't figure out which
type to use.


More information about the Haskell mailing list