Post Reply 
HP41C random number generator help
12-08-2017, 07:43 PM
Post: #22
RE: HP41C random number generator help
(12-08-2017 04:26 AM)Trond Wrote:  I tried a version of this while trying to avoid "bad seeds". I built a program that first checks if the variable 00 has anything above 0 beyond the fifth decimal point, and if not it adds pi, then goes on to multiply with 997, does FRC and STO 00. If 00 does have a digit at the fifth decimal it will simply do the last three steps. Looks to work fine for me, but it is no longer as simple of course.

Why don't you simply do it ...right? There is a clear definition of the minimal properties that have to be met: seven decimals, and the last one must be 1, 3, 7 or 9. This can be done with the following SEED code:

Code:
LBL"SEED"
ABS
FRC
1E6
*
INT
,3
+
1E6
/
STO 00
RTN

Enter a seed, XEQ "SEED", and if neccessary the input is corrected.
Example: pi => 0,1415923

Yes, this simply sets the 7th decimal to 3 even if it was another valid digit like 1, 7 or 9 before. ;-)

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HP41C random number generator help - Trond - 12-05-2017, 05:45 AM
RE: HP41C random number generator help - Dieter - 12-08-2017 07:43 PM



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