Skip to content

Instantly share code, notes, and snippets.

Elias Zacarias battlecoder

Block or report user

Report or block battlecoder

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@battlecoder
battlecoder / rand-period-test.c
Last active Dec 31, 2017 — forked from unprovable/rand-period-test.c
Random Periodicity Test Code for arduino (compiled in Arduino IDE)
View rand-period-test.c
/*
* Test sketch based on rand-period-test.c by @unprovable
* His sketch shown an anomaly with Arduino's PRNG, in which the LCG period seems to be unreliable.
* Also the function seems to be quite slow; iterating over the stream until we get back to the beginning
* takes 199340888ms (55.3724689 hours). It takes 1.5 minutes (approx) to generate 1M numbers.
* So I decided to repeat the test with a textbook implementation of a standard LCG to see if we can get a
* reliable generator with a stable period (and hopefully faster runtime) under the same conditions.
You can’t perform that action at this time.