avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-libc-dev] bug in rand()/random()/do_rand()/do_random( )


From: Joerg Wunsch
Subject: Re: [avr-libc-dev] bug in rand()/random()/do_rand()/do_random( )
Date: Sun, 4 Jan 2009 00:22:07 +0100
User-agent: Mutt/1.5.11

As Mikal Hart wrote:

> For example, if you run a little Arduino sketch (btw, Arduino uses the
> AVR-168P) that calls random() nine times (without seeding), you immedately
> get a repeat in your series:

> 0 31031784 26852320 4242000 842292 453960 211932 84160 0 ... and so on (!)

What version of avr-libc are you using?

You're never supposed to ever get a 0, because the PRNG does not work
whenever it hits a 0.  There's been a bug once but that has been fixed
long since.

> Developers who use Windows don't seem to be affected.  The random()
> and rand() sequences with Windows are entirely reasonable.

That would also be an indication that the issue has been fixed long
since, but the Ubuntu users are apparently using a way old version of
avr-libc (probably since their package maintainer lags quite a couple
of years behind).

> Thanks!  Is there somewhere else that I should post bug reports like
> this?

The bug reporting system can be found at

https://savannah.nongnu.org/bugs/?group=avr-libc

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]