× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



callp ceeran0(seed: float: *omit)
Let x = (%dech(float:63:62) * (max-min + 1))

If max = 15 and min = 5, we have
x = (%dech(float:63:62) * (15-5 + 1))
= (%dech(float:63:62) * (11))
= [0,10] after truncation occurs, where [x,y] is the range of numbers x-y, including x and y.

Now, we have
rnd = [0,10] + min
= [0,10] + 5
= [5,15]

That's how I did it:
callp ceeran0(seed: float: *omit)
rnd = (%dech(float:63:62)
* (max-min+1))
+ min

When I used
rnd = (%dech(float:63:62)
* (max-min+1))
+ (min-1)

I got zero results for [1,10], which makes sense.
(max-min+1) = (10-9+1) = 10
(min-1) = (1-1) = 0

if CEERAN0 returns zero, we get
((0 * 10) + 0)
(0 + 0)
0

Your method looks good.
--buck

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.