From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c76113b004e50a06 X-Google-Attributes: gid103376,public From: Keith Thompson Subject: Re: Gnat Chat, Random Numbers in GNAT Date: 2000/02/05 Message-ID: #1/1 X-Deja-AN: 582100949 Sender: kst@king.cts.com References: <389CBCBF.1DE4F0F@earthlink.net> X-Trace: thoth.cts.com 949798489 62082 198.68.168.21 (6 Feb 2000 00:54:49 GMT) Organization: CTS Network Services Newsgroups: comp.lang.ada X-Complaints-To: newsmaster@cts.com Date: 2000-02-05T00:00:00+00:00 List-Id: Ashley Deas Eachus writes: [...] > The second issue is that the number of possible values generated does > not completely cover all of the representable values in [0.0 .. 1.0). > Again the generator in gnat is much better than most in this area, but it > only generates about 2**50 values, so there are small floating-point values > near zero that cannot be generated. Not a big worry, unless you are > creating events with a very small probability of occurring. [...] If this is an issue, perhaps you can call Random twice for each random number you need. For example, if the Random function gives you a good 32-bit value, you can call it twice to construct a good 64-bit value. (I'm probably missing some vital point here, so don't take my word for it.) -- Keith Thompson (The_Other_Keith) kst@cts.com San Diego Supercomputer Center <*> Welcome to the last year of the 20th century.