Pages: [1]   Go Down
Author Topic: Random function is misleading  (Read 616 times)
0 Members and 1 Guest are viewing this topic.
Montreal
Offline Offline
Newbie
*
Karma: 0
Posts: 22
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The random() functions in Arduino lib is misleading. It returns a long integer (32 bits) but it uses the rand() function in avr stdlib.h which returns an int (16 bits). As thus, I would suggest one of the following two options:

1) That the random() functions in Arduino return integers (16 bits)
or
2) That they make use of the random() / srandom() functions from stdlib.h which return long integers.
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 9
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

This will be fixed in 0013.
Logged

Pages: [1]   Go Up
Jump to: