>Workaround is something like 32768 * Rnd(32767) + Rnd(32767).
>
>
>>>Wouldn't that be *unlikely* to generate numbers less than 32767? Or at<>
>>>least they would be statisticlly skewed away from that lower range.
>>>
Actually, it wouldn't skew at all. Here's a simple example to prove that
"32768 * Rnd(32767) + Rnd(32767)" is almost the right formula. The right
formula is 32767 * Rnd(32767) + Rnd(32767)
If we take a generator which can only produce numbers from 0 to 4
(easier to grasp and chart). The equivalent formula would be: 5 *
Rnd(5) + Rnd(5). This produces:
XValue = 5
YValue = Rnd(5)
ZValue = Rnd(5)
XValue YValue ZValue Result
5 0 0 0
5 0 1 1
5 0 2 2
5 0 3 3
5 0 4 4
5 1 0 5
5 1 1 6
5 1 2 7
5 1 3 8
5 1 4 9
5 2 0 10
5 2 1 11
5 2 2 12
5 2 3 13
5 2 4 14
5 3 0 15
5 3 1 16
5 3 2 17
5 3 3 18
5 3 4 19
5 4 0 20
5 4 1 21
5 4 2 22
5 4 3 23
5 4 4 24
Each number can only be generated by one combination. So long as XValue
= The highest number you can generate + 1.
--
- Charles Barouch
(718) 762-3884 x 1 - Key Ally Voice Mail
[EMAIL PROTECTED] - Consulting services
[EMAIL PROTECTED] - News
[EMAIL PROTECTED] - U2-Users Moderator
[EMAIL PROTECTED] - Zeus Data Integration
Mount Olympus, Home of Zeus Data Integration^(TM)
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/