run time error

Oliver Braun obraun@informatik.unibw-muenchen.de
Fri, 22 Nov 2002 18:34:39 +0100


--PEIAKu/WMn1b1Hv9
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi Fabian,

* Fabian Meier <fabian@meier-bielefeld.de> [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 =3D gc2 a2 (mod a1 a2)
> > gc2 a2 0 =3D 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 =3D a2
> gc2 a1 a2 =3D gc2 a2 (mod a1 a2)

Regards,
         Olli
--=20
{- IST & IIS _ INF _ UniBwM :: obraun@informatik.unibw-muenchen.de -}
{- Tele-Consulting GmbH     :: obraun@Tele-Consulting.com          -}
{- FreeBSD Commmitter       :: obraun@FreeBSD.org                  -}

--PEIAKu/WMn1b1Hv9
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)

iD8DBQE93mqvwLFrfe8lsboRApw9AJsEq1DJeUwKik1b4Q7wImLgt8CZUwCggfJi
ldtkcJE8mWdRL5mL33+jpxI=
=Zhr/
-----END PGP SIGNATURE-----

--PEIAKu/WMn1b1Hv9--