Subject: Re: [SWIPL] random/1

From: Jan Wielemaker <[email-masked]>
Date: Wed, 21 Nov 2001 10:19:56 +0100

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