List Commands Library for 50g
|
10-01-2017, 05:48 PM
(This post was last modified: 10-01-2017 06:34 PM by Thomas Okken.)
Post: #187
|
|||
|
|||
RE: List Commands Library for 50g
(10-01-2017 02:21 PM)John Keith Wrote:(10-01-2017 12:56 PM)pier4r Wrote: or (way longer but pinpointing) It’s not equivalent, though. With CEIL it is possible to get 0, and there is a correspondingly slightly lower probability of getting the maximum value. 1 + IP is the way to go; correctness trumps speed. UPDATE: I just checked the manual (the 48SX manual from the MoHPC documentation set) and it says that RAND returns values in the range 0 <= x <= 1. If that is true, then neither of the above code sequences are correct, because 1 + IP could return SIZE + 1. Seems weird though, I don’t think I’ve ever seen a random number function with that kind of range, it’s usually 0 <= x < 1 or some range of integers. Is the 48SX (and other RPL calculators?) weird in this regard, or is it a typo in the manual? UPDATE 2: The Programmer's Reference Manual says 0 <= x <= 1, and the Owner's Manual says 0 <= x < 1. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 4 Guest(s)