From jan@swi.psy.uva.nl Wed Nov 21 10:20:56 2001
Received: from gollem.swi.psy.uva.nl (gollem [145.18.152.30])
	by swi.psy.uva.nl (8.10.2+Sun/8.11.2) with ESMTP id fAL9Kuf25150;
	Wed, 21 Nov 2001 10:20:56 +0100 (MET)
Received: from localhost (localhost [[UNIX: localhost]])
	by gollem.swi.psy.uva.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id fAL9KvO10502;
	Wed, 21 Nov 2001 10:20:57 +0100
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Organization: SWI, University of Amsterdam
To: Pablo Lopez <lopez@lcc.uma.es>, prolog@swi.psy.uva.nl
Subject: Re: [SWIPL] random/1
Date: Wed, 21 Nov 2001 10:19:56 +0100
X-Mailer: KMail [version 1.0.29.2]
Content-Type: text/plain
References: <3BFB6D29.FCD048E4@lcc.uma.es>
In-Reply-To: <3BFB6D29.FCD048E4@lcc.uma.es>
MIME-Version: 1.0
Message-Id: <01112110205700.10182@gollem>
Content-Transfer-Encoding: 8bit

On Wed, 21 Nov 2001, Pablo Lopez wrote:
>Hi,
>
>I'm using SWI Prolog 4.0.10. The arithmetic predicate
>random/1 behaves as follows:
>
>   % zero argument
>
>   ?- X is random(0).
>   ERROR: Floating point exception
>   [PROLOG STACK:
>   ]
>   % Execution Aborted
>
>   % negative argument
>
>   ?- X is random(-5).
>
>   X = 4 ;
>
>   No
>   ?- 
>
>Jan, I wonder whether that's the intended behavior or 
>just  a simple bug.

Looks like a bug.  Added proper domain-checking in the version in the
CVS repository (pl-arith.c).

	Thanks --- Jan

