|
|
Darcy Johnston <djo### [at] inamecomNOSPAM> wrote:
> Ken <tyl### [at] pacbellnet> wrote in message
> news:374F6CCC.82E06A57@pacbell.net...
> > Rand:
> >
> > When a value is returned from the rand function is there a range
> > it is confined to i.e. 0 - 1, .1 - 10, or ?
> >
> > Is the value returned always a fraction of 1, or less than 100 or can be
> > anything up to and including 20 billion.
>
> According to the docs:
> "The numbers are uniformly distributed, and have values between 0.0 and
1.0,
> inclusively."
>
> But I guess with a little massaging of the numbers, you can make it come
out
> to most any range.
You could allways do a small macro, something like:
#macro rand2(rand_min,rand_max,rseed)
rand_min + (rand_max - rand_min) * rand(rseed)
#end
...written from the top of my head but it should work just fine. I love
macros :)
/Anders
Post a reply to this message
|
|