From MAILER-DAEMON Sun Jun 28 09:18:05 2009 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MKuGj-00023G-Oa for mharc-bug-prolog@gnu.org; Sun, 28 Jun 2009 09:18:05 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MKuGi-00022z-GO for bug-prolog@gnu.org; Sun, 28 Jun 2009 09:18:04 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MKuGe-00022U-U9 for bug-prolog@gnu.org; Sun, 28 Jun 2009 09:18:04 -0400 Received: from [199.232.76.173] (port=42254 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MKuGe-00022R-Pa for bug-prolog@gnu.org; Sun, 28 Jun 2009 09:18:00 -0400 Received: from web63008.mail.re1.yahoo.com ([69.147.96.219]:26470) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1MKuGe-0006WW-CN for bug-prolog@gnu.org; Sun, 28 Jun 2009 09:18:00 -0400 Received: (qmail 87922 invoked by uid 60001); 28 Jun 2009 13:17:56 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1246195076; bh=3njCoCjtadAob2G57o473C4PhWy0mlczASiDMnz1YPM=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=JQ25qT36fLq4j/1CUfCvay/Rbhq2zTi1V8vEjRTzU2yzTs6fFT+UXzpdfSwXBamM/OYbDpCWZS19n4iQvmd59W70SZmqNAaPnEG7cCxN9RehGZrWP9d7Jtt1qA46pYU58BiuStRgmmO0N4GvkXdeKgR7QArnFRSxV4D5PYYAyms= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=bpkFQRIZDL4J2+KpnrW8H/XXAf3I4Hma2uC/mzyhfKaai/IrsNC32AZ0C1lzHjYCeXxV6mN/Dlu5VGXflYe5KiLioITpwTBzmE+m4A6PVkTQFtM8X0RLnc4E1gntYHYPn0cEUJgg45S4CxXud3gguLBMiLJMCyZoOPpATWNJbT0=; Message-ID: <617689.87843.qm@web63008.mail.re1.yahoo.com> X-YMail-OSG: I8ZftR4VM1lQfBtkO8F9bznh6eV0ExUVMpnUrle2pqxgZvraVdm_lHxbbC7FDQk71SxTB4mfQm_fD429OWjKemaxc0IzxdnEFWz3XyhOX48ucKOjlLNHVI0DZR8jpR3ttDsu28e8h8vz0N6Xt1Fd7KDPIYmeaENA_71qrJtuy37RFFwnss6nTEN5vZiRZnhsISn0VDomXIxBcinKuStthd4koI3rwgGCEXRcyI67xxMB7eBfyvkUzJlJX8CQ4GLVEDAW897BUK6sh7uHe_9mKEOzLua5K1ATN9epkO9lyJ3TD64P6flrgN4WP3FhySn15p.puA-- Received: from [70.218.119.70] by web63008.mail.re1.yahoo.com via HTTP; Sun, 28 Jun 2009 06:17:56 PDT X-Mailer: YahooMailClassic/5.4.17 YahooMailWebService/0.7.289.15 Date: Sun, 28 Jun 2009 06:17:56 -0700 (PDT) From: Dave Sworin To: bug-prolog@gnu.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1431710596-1246195076=:87843" X-detected-operating-system: by monty-python.gnu.org: FreeBSD 6.x (1) Subject: random/3 problems? X-BeenThere: bug-prolog@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports for the GNU implementation of Prolog List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jun 2009 13:18:04 -0000 --0-1431710596-1246195076=:87843 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable In gprolog 1.3.1 when I run random/3 with the call below I get integers. random(1.0,10.0,RANDOM_NUMBER). The 1.3.1 manual says that if both Base and Max are integers then Number will be an integer.=A0 I assumed this mean an integer as determined by integer/1 built-in Prolog predicate.=A0 ??? The work-around is easy enough with random/1 so this is not critical. =A0 I also found the following calls to random/3 return the same random number: :- randomize,random(1,10,M),randomize,random(1,10,N).=A0 M and N are=20 the same.=A0 This was only tested so far on a very old Fedora 2 platform, Pentium III and I have not had a chance to try it on a more recent version= =20 of Linux, but it doesn't seem right.=A0 The actual calls where in two(2) different goals, not right after each other, as shown above. =A0 Dave =A0=0A=0A=0A --0-1431710596-1246195076=:87843 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
In gprolog 1.3.1 when I run random/3 wit= h the call below I get integers.
random(1.0,10.0,RANDOM_NUMBER).
The 1.3.1 manual says that if both Base and Max are integers
then Number will be an integer.  I assumed this mean an integer
as determined by integer/1 built-in Prolog predicate.  ???
The work-around is easy enough with random/1 so this is not critical.<= /DIV>
 
I also found the following calls to random/3 return the same random nu= mber:
:- randomize,random(1,10,M),randomize,random(1,10,N).  M and N ar= e
the same.  This was only tested so far on a very old Fedora 2 pla= tform,
Pentium III and I have not had a chance to try it on a more recent ver= sion
of Linux, but it doesn't seem right.  The actual calls where in t= wo(2)
different goals, not right after each other, as shown above.
 
Dave
 

=0A=0A --0-1431710596-1246195076=:87843-- From MAILER-DAEMON Mon Jun 29 04:01:17 2009 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MLBnh-0002DV-Gc for mharc-bug-prolog@gnu.org; Mon, 29 Jun 2009 04:01:17 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MLBne-00029W-4z for bug-prolog@gnu.org; Mon, 29 Jun 2009 04:01:14 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MLBnZ-00022J-3H for bug-prolog@gnu.org; Mon, 29 Jun 2009 04:01:13 -0400 Received: from [199.232.76.173] (port=36833 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MLBnY-000226-VQ for bug-prolog@gnu.org; Mon, 29 Jun 2009 04:01:08 -0400 Received: from asterix.univ-paris1.fr ([193.55.96.71]:49937) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MLBnY-0004Xj-8f for bug-prolog@gnu.org; Mon, 29 Jun 2009 04:01:08 -0400 Received: from [194.214.27.228] (cri-lima.univ-paris1.fr [194.214.27.228]) by asterix.univ-paris1.fr (8.13.4/jtpda-5.5pre1) with ESMTP id n5T80snZ022442 ; Mon, 29 Jun 2009 10:00:54 +0200 Message-ID: <4A4874B6.2050905@univ-paris1.fr> Date: Mon, 29 Jun 2009 10:00:54 +0200 From: Daniel Diaz User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Dave Sworin References: <617689.87843.qm@web63008.mail.re1.yahoo.com> In-Reply-To: <617689.87843.qm@web63008.mail.re1.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (asterix.univ-paris1.fr [193.55.96.71]); Mon, 29 Jun 2009 10:00:54 +0200 (CEST) X-up1-MailScanner-Information: Please contact crir .at. univ-paris1.fr for more information X-up1-MailScanner: Found to be clean X-up1-MailScanner-From: daniel.diaz@univ-paris1.fr X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: bug-prolog@gnu.org Subject: Re: random/3 problems? X-BeenThere: bug-prolog@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports for the GNU implementation of Prolog List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2009 08:01:14 -0000 Dave Sworin wrote: > In gprolog 1.3.1 when I run random/3 with the call below I get integers. > random(1.0,10.0,RANDOM_NUMBER). > The 1.3.1 manual says that if both Base and Max are integers > then Number will be an integer. I assumed this mean an integer > as determined by integer/1 built-in Prolog predicate. ??? > The work-around is easy enough with random/1 so this is not critical. There is no bug here, 1.0 is not a Prolog integer. > > I also found the following calls to random/3 return the same random number: > :- randomize,random(1,10,M),randomize,random(1,10,N). M and N are > the same. This was only tested so far on a very old Fedora 2 platform, > Pentium III and I have not had a chance to try it on a more recent version > of Linux, but it doesn't seem right. The actual calls where in two(2) > different goals, not right after each other, as shown above. This is clearly a bug, thank you for the report. Daniel -- Ce message a ete verifie par MailScanner pour des virus ou des polluriels et rien de suspect n'a ete trouve.