From a5d1941d2868076ca2f60adb4a92faa24393e72e Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sat, 25 Apr 2020 22:21:10 -0400 Subject: [PATCH] Adds necessary standalone #imports; makes safe for signed types. --- Numeric/LFSR.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Numeric/LFSR.hpp b/Numeric/LFSR.hpp index 408ee6725..979d465aa 100644 --- a/Numeric/LFSR.hpp +++ b/Numeric/LFSR.hpp @@ -9,6 +9,9 @@ #ifndef LFSR_h #define LFSR_h +#include +#include + namespace Numeric { template struct LSFRPolynomial {}; @@ -41,11 +44,12 @@ template (&value_); for(size_t c = 0; c < sizeof(IntType); ++c) { - *value_byte = uint8_t(uint64_t(rand()) * 255 / RAND_MAX); + *value_byte = uint8_t(uint64_t(rand()) * 127 / RAND_MAX); ++value_byte; } }