Go Down

Topic: Random function is misleading (Read 1 time) previous topic - next topic


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.


Go Up