Post Reply 
Advanced String Programs (41CX, DM41X, Extended Module Needed)
08-08-2021, 12:45 PM
Post: #2
RE: Advanced String Programs (41CX, DM41X, Extended Module Needed)
(08-07-2021 11:58 PM)Eddie W. Shore Wrote:  To convert this into a random integer from a to b:

randint = round( (b - a + 1) * r, 0) + a = int( (b - a + 1) * r + 1/2 ) + a

This is wrong, giving possible randint of b+1. We should drop the 1/2

0 ≤ r < 1
a ≤ (b-a+1)*r+a < b+1
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Advanced String Programs (41CX, DM41X, Extended Module Needed) - Albert Chan - 08-08-2021 12:45 PM



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