From lopez@lcc.uma.es Wed Nov 21 09:57:46 2001
Received: from cartero.sci.uma.es (cartero.sci.uma.es [150.214.40.41])
	by swi.psy.uva.nl (8.10.2+Sun/8.11.2) with ESMTP id fAL8vjf22242
	for <prolog@swi.psy.uva.nl>; Wed, 21 Nov 2001 09:57:45 +0100 (MET)
Received: from correo.uma.es (vesta.sci.uma.es [150.214.40.21])
	by cartero.sci.uma.es (8.11.0/8.11.0) with ESMTP id fAL8vjl29853
	for <prolog@swi.psy.uva.nl>; Wed, 21 Nov 2001 09:57:45 +0100
Received: from sol10.lcc.uma.es (sol10.lcc.uma.es [150.214.108.1])
	by correo.uma.es (8.9.3/8.9.3) with ESMTP id JAA12398
	for <prolog@swi.psy.uva.nl>; Wed, 21 Nov 2001 09:57:42 +0100 (CET)
Received: from lcc.uma.es by sol10.lcc.uma.es (8.8.8+Sun/SMI-SVR4)
	id JAA15081; Wed, 21 Nov 2001 09:58:21 +0100 (MET)
Message-ID: <3BFB6D29.FCD048E4@lcc.uma.es>
Date: Wed, 21 Nov 2001 10:00:25 +0100
From: Pablo Lopez <lopez@lcc.uma.es>
X-Mailer: Mozilla 4.76 [en] (Windows NT 5.0; U)
X-Accept-Language: en
MIME-Version: 1.0
To: prolog@swi.psy.uva.nl
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Subject: [SWIPL] random/1



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.

Best,

  - Pablo

