ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Curiosity about math.random in LuaTeX
@ 2009-10-23  8:55 Otared Kavian
  2009-10-23 19:44 ` Otared KAVIAN
  0 siblings, 1 reply; 12+ messages in thread
From: Otared Kavian @ 2009-10-23  8:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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…

%%% 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
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread
[parent not found: <mailman.91.1629714784.1197.ntg-context@ntg.nl>]

end of thread, other threads:[~2021-08-23 18:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-23  8:55 Curiosity about math.random in LuaTeX Otared Kavian
2009-10-23 19:44 ` Otared KAVIAN
2009-10-25  8:26   ` Taco Hoekwater
2009-10-25  9:50     ` Thomas A. Schmitz
2009-10-25 20:35       ` Otared Kavian
     [not found] <mailman.91.1629714784.1197.ntg-context@ntg.nl>
2021-08-23 14:46 ` Thierry Horsin via ntg-context
2021-08-23 15:06   ` Henri Menke via ntg-context
2021-08-23 15:13   ` Hans Hagen via ntg-context
2021-08-23 15:24     ` Hans van der Meer via ntg-context
2021-08-23 15:49       ` Henri Menke via ntg-context
2021-08-23 16:25       ` Hans Hagen via ntg-context
2021-08-23 18:09     ` Thierry Horsin via ntg-context

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).