dbTalk Databases Forums  

AIX/d3 7.4 - Flashbasic rnd(numeriic expression) command question

comp.databases.pick comp.databases.pick


Discuss AIX/d3 7.4 - Flashbasic rnd(numeriic expression) command question in the comp.databases.pick forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Robert S. Lobel
 
Posts: n/a

Default AIX/d3 7.4 - Flashbasic rnd(numeriic expression) command question - 07-31-2006 , 08:16 PM






Easy one, I think. While the Raining Data documentation, including the most
recent (7/25) on-line documentation, suggests that the maximum "numeric
expression" for the basic function rnd() is 32000, much higher values seem
to also compile and run properly. Does anyone have the definitive answer?

Thanks,
Rob



Reply With Quote
  #2  
Old   
Mark Brown
 
Posts: n/a

Default Re: AIX/d3 7.4 - Flashbasic rnd(numeriic expression) command question - 07-31-2006 , 08:57 PM






I re-wrote the random number generator to make it more "random" in '91. It
uses a 4 byte work field, so theoretically any number +/- h8FFFFFFF or +/-
2,415,919,103

But, Basic will slap you with the precision shift. It divides your number
by the scaleing factor (usually 10,000) and mulitplies again at the end, to
keep the decimals right in an integer world.

Mark Brown

"Robert S. Lobel" <RobertLobel (AT) COX (DOT) net> wrote

Quote:
Easy one, I think. While the Raining Data documentation, including the
most
recent (7/25) on-line documentation, suggests that the maximum "numeric
expression" for the basic function rnd() is 32000, much higher values seem
to also compile and run properly. Does anyone have the definitive answer?

Thanks,
Rob





Reply With Quote
  #3  
Old   
Robert S. Lobel
 
Posts: n/a

Default Re: AIX/d3 7.4 - Flashbasic rnd(numeriic expression) command question - 07-31-2006 , 09:27 PM



Thanks, Mark. Does this mean that rnd(90,000) will produce 90,000 random
numbers? Let me know.
"Mark Brown" <mbrown (AT) drexelmgt (DOT) com> wrote

Quote:
I re-wrote the random number generator to make it more "random" in '91.
It
uses a 4 byte work field, so theoretically any number +/- h8FFFFFFF or +/-
2,415,919,103

But, Basic will slap you with the precision shift. It divides your number
by the scaleing factor (usually 10,000) and mulitplies again at the end,
to
keep the decimals right in an integer world.

Mark Brown

"Robert S. Lobel" <RobertLobel (AT) COX (DOT) net> wrote in message
news:1Yxzg.221$0F5.210 (AT) fed1read04 (DOT) ..
Easy one, I think. While the Raining Data documentation, including the
most
recent (7/25) on-line documentation, suggests that the maximum "numeric
expression" for the basic function rnd() is 32000, much higher values
seem
to also compile and run properly. Does anyone have the definitive
answer?

Thanks,
Rob







Reply With Quote
  #4  
Old   
Mark Brown
 
Posts: n/a

Default Re: AIX/d3 7.4 - Flashbasic rnd(numeriic expression) command question - 08-01-2006 , 12:22 AM



The random number generator creates a great huge number based on date and
time and a couple of huge constants. Then it divides by your "seed" and
returns the remainder.

rnd(90,000) will return 90,000 possible answers (0-89,999). Each time it's
run, it will start over and generate a whole new number. So, yes, there are
90,000 answers, but you can go a long time before you ever see them all.

Mark Brown


"Robert S. Lobel" <RobertLobel (AT) COX (DOT) net> wrote

Quote:
Thanks, Mark. Does this mean that rnd(90,000) will produce 90,000 random
numbers? Let me know.
"Mark Brown" <mbrown (AT) drexelmgt (DOT) com> wrote in message
news:Hyyzg.6585$%a1.4764 (AT) tornado (DOT) socal.rr.com...
I re-wrote the random number generator to make it more "random" in '91.
It
uses a 4 byte work field, so theoretically any number +/- h8FFFFFFF or
+/-
2,415,919,103

But, Basic will slap you with the precision shift. It divides your
number
by the scaleing factor (usually 10,000) and mulitplies again at the end,
to
keep the decimals right in an integer world.

Mark Brown

"Robert S. Lobel" <RobertLobel (AT) COX (DOT) net> wrote in message
news:1Yxzg.221$0F5.210 (AT) fed1read04 (DOT) ..
Easy one, I think. While the Raining Data documentation, including the
most
recent (7/25) on-line documentation, suggests that the maximum "numeric
expression" for the basic function rnd() is 32000, much higher values
seem
to also compile and run properly. Does anyone have the definitive
answer?

Thanks,
Rob









Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.