From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/53643 Path: news.gmane.org!not-for-mail From: Otared KAVIAN Newsgroups: gmane.comp.tex.context Subject: Curiosity about math.random in LuaTeX Date: Fri, 23 Oct 2009 21:44:53 +0200 Message-ID: <3cb063a60910231244r441b3e58ud3b013aa4b5f81c4@mail.gmail.com> References: <3E1D310B-06AE-4B36-B2FF-E60A412A3992@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2128718914==" X-Trace: ger.gmane.org 1256456943 5426 80.91.229.12 (25 Oct 2009 07:49:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 25 Oct 2009 07:49:03 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Oct 25 08:48:57 2009 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.50) id 1N1xqS-0002Rq-FN for gctc-ntg-context-518@m.gmane.org; Sun, 25 Oct 2009 08:48:56 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id CC29EC9C8C; Sun, 25 Oct 2009 08:44:49 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id BLMN2M6zgBDx; Sun, 25 Oct 2009 08:44:47 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 7BFEBC9C8D; Sun, 25 Oct 2009 08:42:49 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id D8ED5C9A70 for ; Sat, 24 Oct 2009 12:20:45 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id QDvQryb3ojMA for ; Sat, 24 Oct 2009 12:20:43 +0200 (CEST) Original-Received: from ey-out-1920.google.com (ey-out-1920.google.com [74.125.78.144]) by balder.ntg.nl (Postfix) with ESMTP id BE37FC9A63 for ; Sat, 24 Oct 2009 12:20:43 +0200 (CEST) Original-Received: by ey-out-1920.google.com with SMTP id 26so457653eyw.6 for ; Sat, 24 Oct 2009 03:21:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=a7N5TG+MT43KHU+S15RvSIp61tFr0CBHvoCKoieq880=; b=M7prrrlA3wLRSY2kTqtaGX3rpKnUko5KRWt3TXblWQnnazOsfaUeNyy9NKKKW2jf+L 256+ApzBluf5oYfeCb0Ks2EcONmiXsvWOaYDPcQ+hgd2uD/mOELtSawulx1o+U1KMx1e RAogx7DPCpyZl1nb530cUSkmhqWMZv1yIyDHY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=KD9QfsOmK4cWUNUadXVXC5jY6O2Te+9lApXjfXMjr66x8HDk1+30z+kf2J/BNTSKgR CYssiFJyXpyCLzgo4X68tE+GuZ9Bh3Oisrt40dTqQubJKLr2Yt/uxbJDfrO9d8Vhm4gf elS8fnKkI1z8zgGlc2lWU/kRpFBeqmQOi0Uko= Original-Received: by 10.216.90.67 with SMTP id d45mr50532wef.42.1256327093262; Fri, 23 Oct 2009 12:44:53 -0700 (PDT) In-Reply-To: <3E1D310B-06AE-4B36-B2FF-E60A412A3992@gmail.com> X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:53643 Archived-At: --===============2128718914== Content-Type: multipart/alternative; boundary=0016e6d7df781d99d404769f7235 --0016e6d7df781d99d404769f7235 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi all, This is a curiosity question about the function math.random coming from Lua and used in mkiv: if I typeset the following test file in mkiv, no matter when nor how many times, the sequence of numbers which are output are the same=E2=80=A6 %%% begin test-random.tex \starttext \dorecurse{25}{% \ctxlua{tex.print(math.random(110,150))} \qquad \ctxlua{tex.print(math.random(math.random(110,120),math.random(140,150)))} \par} \stoptext %%% end test-random.tex Indeed I guess that this is due to the random seed used by LuaTeX: is it possible to force a new random seed upon each typesetting? Thanks for your attention: OK --0016e6d7df781d99d404769f7235 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Hi all,

This is a curiosity question about the function math.random coming from Lua= and used in mkiv:
if I typeset the following test file in mkiv, no matter when nor how many t= imes, the sequence of numbers which are output are the same=E2=80=A6

%%% begin test-random.tex

\starttext

\dorecurse{25}{%
\ctxlua{tex.print(math.random(110,150))}
\qquad
\ctxlua{tex.print(math.random(math.random(110,120),math.random(140,150)))}<= br> \par}

\stoptext

%%% end test-random.tex

Indeed I guess that this is due to the random seed used by LuaTeX: is it po= ssible to force a new random seed upon each typesetting?

Thanks for your attention: OK

--0016e6d7df781d99d404769f7235-- --===============2128718914== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ --===============2128718914==--