Post Reply 
(12C) Random Number (No Seed Needed)
12-31-2017, 08:34 AM
Post: #2
RE: (12C) Random Number (No Seed Needed)
You can save a few bytes of code and generate numbers from 1 to 999999 (instead of 999998).

The result of FRAC is necessarily going to be less than one, so multiply it by "1E6" instead of 999999 before taking the integer part.

Either that or do what most PRNGs do on calculators and just return the fractional part.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (12C) Random Number (No Seed Needed) - grsbanks - 12-31-2017 08:34 AM



User(s) browsing this thread: 1 Guest(s)