<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV><DIV>On Sep 30, 2006, at 2:46 AM, Glynn Clements wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV><BR></DIV><DIV>William Kyngesburye wrote:</DIV><DIV><BR></DIV> <BLOCKQUOTE type="cite"><DIV>I just did a quick test - removed __APPLE__ from r.random, so it uses  </DIV><DIV>the extern lrand48.  I now get a random distribution.</DIV> </BLOCKQUOTE><DIV><BR></DIV><DIV>So it's the fake lrand48() that's causing problems?</DIV><DIV><BR></DIV><DIV>Doh.</DIV><DIV><BR></DIV></BLOCKQUOTE><DIV>...</DIV><BR><BLOCKQUOTE type="cite"><DIV>Can you try this instead:</DIV><DIV><BR></DIV><DIV>#define lrand48() (((long) rand() ^ ((long) rand() &lt;&lt; 16)) &amp; 0x7FFFFFFF)</DIV><DIV><BR></DIV></BLOCKQUOTE>That works.<BR></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>So, was there some other reason to use the fake lrand48() on OS X, since the real one seems to work?</DIV><BR> <DIV>-----</DIV><DIV>William Kyngesburye &lt;<A href="mailto:kyngchaos@kyngchaos.com">kyngchaos@kyngchaos.com</A>&gt;</DIV><DIV><A href="http://www.kyngchaos.com">http://www.kyngchaos.com</A>/</DIV><DIV><BR></DIV><DIV>"Mon Dieu! but they are all alike.  Cheating, murdering, lying, fighting, and all for things that the beasts of the jungle would not deign to possess - money to purchase the effeminate pleasures of weaklings.  And yet withal bound down by silly customs that make them slaves to their unhappy lot while firm in the belief that they be the lords of creation enjoying the only real pleasures of existence....</DIV><DIV><BR></DIV><DIV>- the wisdom of Tarzan</DIV><BR class="Apple-interchange-newline"> <BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>-----</DIV><DIV>William Kyngesburye &lt;<A href="mailto:kyngchaos@kyngchaos.com">kyngchaos@kyngchaos.com</A>&gt;</DIV><DIV><A href="http://www.kyngchaos.com">http://www.kyngchaos.com</A>/</DIV><DIV><BR></DIV><DIV>All generalizations are dangerous, even this one.</DIV><BR class="Apple-interchange-newline"></SPAN> </DIV><BR></BODY></HTML>