Pages: [1]   Go Down
Author Topic: Rand() function  (Read 634 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Dear readers,

I am trying to implement the rand function that arduino uses in other language but i cannot get the code, i have read that it uses the same rand function that C++ uses. My question is if anybody can give me a webpage where the code is located or directly the code.

Thanks to all.
Best Regards.
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 200
Posts: 12779
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


The AVR Libc rand function packaged with Arduino is a variation of the Park-Miller minimal random number generator.

All of the AVR Libc source code is available from here...

http://www.nongnu.org/avr-libc/

The most recent version of rand is available here...

http://svn.savannah.nongnu.org/viewvc/trunk/avr-libc/libc/stdlib/rand.c?revision=1944&root=avr-libc&view=markup
Logged

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

google 1103515245.

More than what you want to know about random number generators.
Logged

Pages: [1]   Go Up
Jump to: