Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Another Xml Random Number Generator

Featured Replies

In the 'For What It's Worth' category, here's another XML Random Number generator. This one is based on a multiplicative linear congruential generator method described by Pierre L'Ecuyer in a 1988 Association for Computing Machinery paper. The code below generates a random number between (but never equal to) 0 and 1 every Update cycle. It has a period of 2.30584 X 10^18, meaning that at an Update cycle rate of 18, the pattern will not repeat for a little over 4 billion years.

<Macro Name="XMLRandom">	(L:RandomSeed1,number) 0 == (L:RandomSeed2,number) 0 == ||		if{			(P:Absolute Time,seconds) abs d 2147483563 % (>L:RandomSeed1,number)			sqrt d d * * abs 2147483599 % (>L:RandomSeed2,number)		}	(L:RandomSeed1,number) 40014 * 2147483563 % (>L:RandomSeed1,number) 	(L:RandomSeed2,number) 40692 * 2147483399 % (>L:RandomSeed2,number) 	(L:RandomSeed1,number) (L:RandomSeed2,number) - 2147483563 / s1	l1 0 < if{ l1 ++ s1 }	l1</Macro><Update>	@XMLRandom (>L:RandomNumber,number)</Update>

L'Ecuyer, Pierre, 1988, Efficient and Portable Combined Random Number Generators, Association for Computing Machineryhttp://portal.acm.org/citation.cfm?id=6295...FTOKEN=18338685Acknowledgements owed to Ron Freimuth, Nike Pike, and Tom (taquilo) who have posted xml random number code in this forum before. The MLCG code above is another variety. Acknowledgement also to my son, Robbie, for writing the xml snippet based on the L'Ecuyer paper.Bob

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.