Pages: [1]   Go Down
Author Topic: Random function is misleading  (Read 753 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
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)
2) That they make use of the random() / srandom() functions from stdlib.h which return long integers.

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

This will be fixed in 0013.

Pages: [1]   Go Up
Jump to: