On 8/16/2011 12:05, Felipe Monteiro de Carvalho wrote:
Another idea:
-1 * Random(127);
this was what i was thinking of as it doesn't limit the number to any particular
size as the following seems to do...
random(128)-127;
what would happen with this?
random(4096)-127;
;)
___
On 8/16/2011 11:54, Luis Fernando Del Aguila Mejía wrote:
thansk
El 16/08/2011 10:36 a.m., Jonas Maebe escribió:
On 16 Aug 2011, at 17:25, Luis Fernando Del Aguila Mejía wrote:
I have a doubt.
With the random function, Can you generate random numbers negative?
Begin
randomize;
Writeln (rando
Another idea:
-1 * Random(127);
--
Felipe Monteiro de Carvalho
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
thansk
El 16/08/2011 10:36 a.m., Jonas Maebe escribió:
On 16 Aug 2011, at 17:25, Luis Fernando Del Aguila Mejía wrote:
I have a doubt.
With the random function, Can you generate random numbers negative?
Begin
randomize;
Writeln (random (-127)) / / 0> = n> -127
End.
random(128)-127;
Jonas
I have a doubt.
With the random function, Can you generate random numbers negative?
Begin
randomize;
Writeln (random (-127)) / / 0> = n> -127
End.
thanks.
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/l
Antal wrote:
It's not just that, but randseed is not a threadvar. This means that
all your threads use the same randseed variable, so if two threads
call "random" at the same time they will still get the same "random"
number.
Jonas
And also generating a rand * getpid you can't really get goo
(Second send, it seems that mails from my old email address do not reach
fpc lists)
Antal wrote:
It's not just that, but randseed is not a threadvar. This means that
all your threads use the same randseed variable, so if two threads
call "random" at the same time they will still get the same "
Quoting Vinzent Hoefler <[EMAIL PROTECTED]>:
> The Mersenne Twister Free Pascal uses is one of the best PRNGs known
> today, it just has to be used the right way. But calling it from
> several threads and "randomly" overwriting its state array is
> definitely not the right way to use it.
Well
Why not use GUID's (or the other name is UUID's) and convert them to a
Integer from Hex. You might need to make the GUID value smaller, or
part of the GUID (example the last block).
Regards,
- Graeme -
On 3/3/06, Antal <[EMAIL PROTECTED]> wrote:
> >
> > It's not just that, but randseed is n
On Friday 03 March 2006 11:06, Antal wrote:
> Maybe a bit shifting or some aritmetical function can help to
> obtain a more random "looking" number.
No. Don't do that:
|Random numbers should not be generated with a method chosen at random.
| -- Donald E. Knuth
|The generation of random nu
It's not just that, but randseed is not a threadvar. This means that
all your threads use the same randseed variable, so if two threads
call "random" at the same time they will still get the same "random"
number.
Jonas
And also generating a rand * getpid you can't really get good random
number
11 matches
Mail list logo