Re: run time error

Oliver Braun <[email protected]>
Newsgroups gmane.comp.lang.haskell.hugs.bugs
Message-ID <[email protected]>
Hi Fabian,

* Fabian Meier <[email protected]> [2002-11-22 14:55 +0100]:
> The file versuch.lhs (attachment) consists of a function gc2. If you
> try gc2 25 15, hugs produces a run time error.

> gc2 ist defined as:

> > gc2::Int->Int->Int
> > gc2 a1 a2 = gc2 a2 (mod a1 a2)
> > gc2 a2 0 = a2

You have to change the last two lines, and learn how pattern matching in
Haskell works ;o)

> gc2::Int->Int->Int
> gc2 a2 0 = a2
> gc2 a1 a2 = gc2 a2 (mod a1 a2)

Regards,
         Olli
-- 
{- IST & IIS _ INF _ UniBwM :: [email protected] -}
{- Tele-Consulting GmbH     :: [email protected]          -}
{- FreeBSD Commmitter       :: [email protected]                  -}
signature.asc (application/pgp-signature, 187 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)

iD8DBQE93mqvwLFrfe8lsboRApw9AJsEq1DJeUwKik1b4Q7wImLgt8CZUwCggfJi
ldtkcJE8mWdRL5mL33+jpxI=
=Zhr/
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.