From ino-waiting@gmx.net  Wed May 10 08:22:29 2000
Received: from mout1.freenet.de (mout1.freenet.de [194.97.50.132])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id IAA10862
	for <prolog@swi.psy.uva.nl>; Wed, 10 May 2000 08:22:29 +0200 (MET DST)
From: ino-waiting@gmx.net
Received: from [194.97.50.136] (helo=mx3.freenet.de)
	by mout1.freenet.de with esmtp (Exim 3.14 #3)
	id 12pPtH-00040z-00
	for prolog@swi.psy.uva.nl; Wed, 10 May 2000 08:22:39 +0200
Received: from [213.6.9.40] (helo=spotteswoode.de)
	by mx3.freenet.de with smtp (Exim 3.14 #3)
	id 12pPtF-00081j-00
	for prolog@swi.psy.uva.nl; Wed, 10 May 2000 08:22:38 +0200
Received: (qmail 1445 invoked by uid 0); 10 May 2000 06:21:55 -0000
Date: Wed, 10 May 2000 08:21:55 +0200
To: prolog@swi.psy.uva.nl
Subject: Re: handling small numbers
Message-ID: <20000510082155.C1285@spotteswoode.de>
Mail-Followup-To: prolog@swi.psy.uva.nl
References: <200005100257.OAA31206@atlas.otago.ac.nz>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Mailer: Mutt 1.0.1i
In-Reply-To: <200005100257.OAA31206@atlas.otago.ac.nz>; from ok@atlas.otago.ac.nz on Wed, May 10, 2000 at 02:57:08PM +1200
Organization: private

> Richard A. O'Keefe (Wed 10.0500-14:57):
> It has been possible to go off and do something else for longer than
> SWI Prolog has existed, thanks to the freely available LONG.PL.

where can i get LONG.PL?

>     ?- quotient_and_remainder(70000, 70000, 0, 10000, Q, R).
> 
> blows up:
>     ERROR: ///2: Type error: `integer' expected, found `4.9e+09'
>     ^  Exception: (7) _G454 is 4.9e+09//10000 ? 
> 
> [...]
> 
> >From my point of view, the problem here is a bug in SWI Prolog.
> It has raise the wrong exception and the wrong point.
> The *real* problem is that the multiplication of 70000 by 70000
> overflowed.

agreed.  the exception is ok, but should be raised earlier on the integer
multiplication overflow.  if type promotion were to be employed, it could
engage bigints, but only if all operators were overloaded properly and the
external representation wouldn't change.  and since this is a tricky thing,
one should silently use bigints in the first place, =unless= the user is
advised of the restricted range of input values to quotient_and_reminder/6.
not doing so and not using a bigint package is bad design, in other words,
doing so or using a bigint package is good design 7^)

> Anything that separates the symptom from the cause is regrettable.

very true.  i'd like to see this attitude applied to this discussion thread.

-- 
clemens                            (ino-waiting@gmx.net, pgp key available)

