Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2011-08

random numbers negative

6 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Luis Fernando Del Aguila Mejía

I have a doubt.
With the random function, Can you generate random numbers negative?

Begin
randomize;
Writeln (random (-127)) / / 0> = n> -127
End.

thanks.

Reply by email

Luis Fernando Del Aguila Mejía

thansk

Jonas Maebe wrote 13 lines
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

Reply by email

waldo kitty
to Luis Fernando Del Aguila Mejía: thansk
Luis Fernando Del Aguila Mejía wrote 16 lines
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

interesting... i don't see jonas' reply in the list at all... was it private only?

Reply by email