Open
Description
Hi,
In function randomSeed
(WMath.cpp
, line 30) there's the code
if (seed != 0) {
srandom(seed);
}
Since "srandom" handles the value 0 itself (see for example its implementation in random.c
of AVR-Libc*), it seems there's no need for that "if". Furthermore, it is undocumented and may break functionality - for instance, if a user wants to produce two identical pseudo-random sequences using the seed 0.
If that "if" can be removed, it will save a byte or two.
See discussion about this here (not all of it directly relevant): https://forum.arduino.cc/t/randomseed-why-is-0-ignored/337424
Thanks,