random()

mkoch

Active member
random() without any argument seems to give a random number in the range [-2147483648 to 2147483647].
How can I convert this number to an unsigned long in the range [0 to 4294967295]?

Thanks,
Michael
 
When I use random(65535*65535) and move the mouse over "random", then it's shown that the type is uint32_t. However when compiling, I get an integer overflow warning. Why?
 
Use ((uint32_t)random()).

This casts the value to unsigned 32-bit value with exactly that range.

What I wrote above was wrong. It seems random() gives only positive numbers from 0 to 2^31-1.
random(4294967295) gives no compiler warning, but the numbers are always smaller than 2^31, always in the lower half of the uint32 range.

My question is: How can I generate a full-range uint32 random number?

Michael
 
I habitually use the 32 high bits of the Xorshift64* PRNG, which tends to be faster than the LCG used in Teensyduino, but also passes all randomness tests in the BigCrush set in TestU01 framework (the "golden standard" for statistical randomness testing).

Code:
uint64_t  prng_state;

uint32_t  prng_u32(void)
{
    uint64_t  x = prng_state;
    x ^= x >> 12;
    x ^= x << 25;
    x ^= x >> 27;
    prng_state = x;
    return (x * UINT64_C(2685821657736338717)) >> 32;
}
You do need to initialize the prng_state to a nonzero value. Using the Entropy library, for example:
Code:
void setup()
{
    Entropy.Initialize();

    prng_state = Entropy.random();
    do {
        prng_state = (prng_state << 32) | Entropy.random();
    } while (!prng_state);

    // Other setup() stuff
}
After prng_state has been initialized to a nonzero value (remembering that because these are pseudorandom numbers, the same seed value will generate the same sequence of random numbers), just call prng_u32() to get a value between 0 and 2³²-1, inclusive; i.e. 32 random bits.
 
Last edited:
My question is: How can I generate a full-range uint32 random number?

Random returns uint32_t if its parameters are uint32_t. However, as you observed, it only returns values from 0 to 2^31. Same for the standard C "rand()" function. C++ provides much better random generators in its <random> header. You can e.g. use the mt19937 generator which uses a Mersenne twister algorithm and is very efficient.

Here an example:
Code:
#include <random>

std::mt19937 myRandomGenerator(millis()); // the generator needs some seed value

void setup()
{
}

void loop()
{
    uint32_t r =  myRandomGenerator();  // generate a new random number
    
    Serial.printf("%08X %s\n",r, r > 0x7FFF'FFFF ? "Large" : "Small");  // print it in HEX and see if it is larger than 2^31
    delay(1);
}

This prints:
Code:
BAE2B872 Large
558EB015 Small
3C55CD9C Small
56249CF0 Small
61B49EA7 Small
3425D586 Small
4DB65821 Small
8A67FF5D Large
B47C6138 Large
8EDDFF4D Large
FF0CB5C0 Large
0D17F36C Small
4FE1B53F Small
985A468B Large
FB5B098E Large
2E8B4C27 Small
88DE575F Large
B26212D6 Large
...
 
Random returns uint32_t if its parameters are uint32_t. However, as you observed, it only returns values from 0 to 2^31. Same for the standard C "rand()" function.

Technically rand() returns numbers between 0 and RAND_MAX. I've run into issues with older code (specifically for platforms where int wasn't 32 bits) that made assumptions about the maximum value instead of using RAND_MAX.
 
While Mersenne Twister is widely researched and considered the gold standard of pseudo-random number generators, George Marsaglia's Xorshift64* is both faster and better, as Mersenne Twister fails two linear congruence tests in the BigCrush test suite, whereas the generator I showed passes all tests; and MT requires quite a lot of state (2492 bytes versus 8 bytes).

(I do HPC, including various simulations that depend on sufficiently "random" random numbers, and am quite familiar with various PRNGs. Some of them are sensitive to folding bias, so for ranges, I use only the necessary number of high bits and the exclusion method to get truly uniform pseudorandom numbers. The exclusion method does up to double the asymptotic cost of the random number generator, but the 32 high bits of Xorshift64* are fast enough to compute so it does not actually matter.)

The reason libraries use "poor" LCGs is the desire for implementations to reproduce the same pseudorandom number sequences. Mersenne Twister is well known ("nobody has ever gotten flak for relying on MT19937") and easily verified. Xorshift family was only introduced in 2003, and the fact that Xorshift64*'s 32-40 high bits do pass all BigCrush tests was noted in 2014 by Melissa E. O'Neill, relatively recently considering library implementations and numerical computation in general.
 
@luni - found REF notes geeksforgeeks.org/stdmt19937-class-in-cpp/
Tried building p#6 sketch (and geeks sample) and with TD 1.59b2 it fails?:
Code:
Arduino: 1.8.19 (Windows 10), TD: 1.59-beta2, Board: "Teensy 4.0, Serial, 600 MHz, Faster, US English"
...
Compiling sketch...

"C:\\T_Drive\\arduino-1.8.19\\hardware\\teensy/../tools/precompile_helper" "C:\\T_Drive\\arduino-1.8.19\\hardware\\teensy\\avr/cores/teensy4" "C:\\Users\\Tim\\AppData\\Local\\Temp\\arduino_build_233238" "C:\\T_Drive\\arduino-1.8.19\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -x c++-header -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -std=gnu++17 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=159 -DARDUINO=10819 -DARDUINO_TEENSY40 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\T_Drive\\arduino-1.8.19\\hardware\\teensy\\avr/cores/teensy4" "C:\\Users\\Tim\\AppData\\Local\\Temp\\arduino_build_233238/pch/Arduino.h" -o "C:\\Users\\Tim\\AppData\\Local\\Temp\\arduino_build_233238/pch/Arduino.h.gch"

"C:\\T_Drive\\arduino-1.8.19\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -c -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -std=gnu++17 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=159 -DARDUINO=10819 -DARDUINO_TEENSY40 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\Users\\Tim\\AppData\\Local\\Temp\\arduino_build_233238/pch" "-IC:\\T_Drive\\arduino-1.8.19\\hardware\\teensy\\avr\\cores\\teensy4" "C:\\Users\\Tim\\AppData\\Local\\Temp\\arduino_build_233238\\sketch\\CppMT19937.ino.cpp" -o "C:\\Users\\Tim\\AppData\\Local\\Temp\\arduino_build_233238\\sketch\\CppMT19937.ino.cpp.o"

In file included from C:\T_Drive\arduino-1.8.19\hardware\teensy\avr\cores\teensy4/WProgram.h:46,

                 from C:\Users\Tim\AppData\Local\Temp\arduino_build_233238\pch\Arduino.h:6:

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc: In member function 'void std::poisson_distribution<_IntType>::param_type::_M_initialize()':

C:\T_Drive\arduino-1.8.19\hardware\teensy\avr\cores\teensy4/wiring.h:174:18: error: expected unqualified-id before '(' token

  174 | #define round(x) ((long) __builtin_round(x))

      |                  ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc: In member function 'std::poisson_distribution<_IntType>::result_type std::poisson_distribution<_IntType>::operator()(_UniformRandomNumberGenerator&, const std::poisson_distribution<_IntType>::param_type&)':

C:\T_Drive\arduino-1.8.19\hardware\teensy\avr\cores\teensy4/wiring.h:164:16: error: expected unqualified-id before '(' token

  164 | #define abs(x) ({ \

      |                ^

C:\T_Drive\arduino-1.8.19\hardware\teensy\avr\cores\teensy4/wiring.h:165:3: error: expected primary-expression before 'typeof'

  165 |   typeof(x) _x = (x); \

      |   ^~~~~~

C:\T_Drive\arduino-1.8.19\hardware\teensy\avr\cores\teensy4/wiring.h:165:3: error: expected '}' before 'typeof'

C:\T_Drive\arduino-1.8.19\hardware\teensy\avr\cores\teensy4/wiring.h:164:17: note: to match this '{'

  164 | #define abs(x) ({ \

      |                 ^

C:\T_Drive\arduino-1.8.19\hardware\teensy\avr\cores\teensy4/wiring.h:165:3: error: expected ')' before 'typeof'

  165 |   typeof(x) _x = (x); \

      |   ^~~~~~

C:\T_Drive\arduino-1.8.19\hardware\teensy\avr\cores\teensy4/wiring.h:164:16: note: to match this '('

  164 | #define abs(x) ({ \

      |                ^

C:\T_Drive\arduino-1.8.19\hardware\teensy\avr\cores\teensy4/wiring.h:166:4: error: '_x' was not declared in this scope; did you mean '__x'?

  166 |   (_x > 0) ? _x : -_x; \

      |    ^~

C:\T_Drive\arduino-1.8.19\hardware\teensy\avr\cores\teensy4/wiring.h:167:2: error: expected primary-expression before ')' token

  167 | })

      |  ^

In file included from c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\random:51,

                 from C:\T_Drive\tCode\RANDOM\CppMT19937\CppMT19937.ino:3:

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1346:38: error: '__y' was not declared in this scope; did you mean '__w'?

 1346 |                     __x = std::floor(__y);

      |                                      ^~~

      |                                      __w

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1347:28: error: '__n' was not declared in this scope; did you mean '__w'?

 1347 |                     __w = -__n * __n / 2;

      |                            ^~~

      |                            __w

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1351:22: error: expected 'while' before 'if'

 1351 |                 else if (__u <= __c2)

      |                      ^~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1351:22: error: expected '(' before 'if'

 1351 |                 else if (__u <= __c2)

      |                      ^~

      |                      (

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1351:22: error: expected primary-expression before 'if'

 1351 |                 else if (__u <= __c2)

      |                      ^~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1351:21: error: expected ')' before 'if'

 1351 |                 else if (__u <= __c2)

      |                     ^~~

      |                     )

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1351:21: error: expected ';' before 'if'

 1351 |                 else if (__u <= __c2)

      |                     ^~~

      |                     ;

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1351:26: error: '__u' was not declared in this scope; did you mean '_Mu'?

 1351 |                 else if (__u <= __c2)

      |                          ^~~

      |                          _Mu

In file included from C:\T_Drive\arduino-1.8.19\hardware\teensy\avr\cores\teensy4/WProgram.h:46,

                 from C:\Users\Tim\AppData\Local\Temp\arduino_build_233238\pch\Arduino.h:6:

C:\T_Drive\arduino-1.8.19\hardware\teensy\avr\cores\teensy4/wiring.h:164:16: error: expected unqualified-id before '(' token

  164 | #define abs(x) ({ \

      |                ^

C:\T_Drive\arduino-1.8.19\hardware\teensy\avr\cores\teensy4/wiring.h:165:3: error: expected primary-expression before 'typeof'

  165 |   typeof(x) _x = (x); \

      |   ^~~~~~

C:\T_Drive\arduino-1.8.19\hardware\teensy\avr\cores\teensy4/wiring.h:165:3: error: expected '}' before 'typeof'

C:\T_Drive\arduino-1.8.19\hardware\teensy\avr\cores\teensy4/wiring.h:164:17: note: to match this '{'

  164 | #define abs(x) ({ \

      |                 ^

C:\T_Drive\arduino-1.8.19\hardware\teensy\avr\cores\teensy4/wiring.h:165:3: error: expected ')' before 'typeof'

  165 |   typeof(x) _x = (x); \

      |   ^~~~~~

C:\T_Drive\arduino-1.8.19\hardware\teensy\avr\cores\teensy4/wiring.h:164:16: note: to match this '('

  164 | #define abs(x) ({ \

      |                ^

C:\T_Drive\arduino-1.8.19\hardware\teensy\avr\cores\teensy4/wiring.h:166:4: error: '_x' was not declared in this scope; did you mean '__x'?

  166 |   (_x > 0) ? _x : -_x; \

      |    ^~

C:\T_Drive\arduino-1.8.19\hardware\teensy\avr\cores\teensy4/wiring.h:167:2: error: expected primary-expression before ')' token

  167 | })

      |  ^

In file included from c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\random:51,

                 from C:\T_Drive\tCode\RANDOM\CppMT19937\CppMT19937.ino:3:

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1355:37: error: '__y' was not declared in this scope; did you mean '__c'?

 1355 |                     __x = std::ceil(__y);

      |                                     ^~~

      |                                     __c

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1356:21: error: '__w' was not declared in this scope; did you mean '__c'?

 1356 |                     __w = __y * (2 - __y) * __param._M_1cx;

      |                     ^~~

      |                     __c

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1358:23: error: continue statement not within a loop

 1358 |                       continue;

      |                       ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1360:26: error: '__u' was not declared in this scope; did you mean '_Mu'?

 1360 |                 else if (__u <= __c3)

      |                          ^~~

      |                          _Mu

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1360:33: error: '__c3' was not declared in this scope

 1360 |                 else if (__u <= __c3)

      |                                 ^~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1363:19: error: '__x' was not declared in this scope

 1363 |                   __x = -1;

      |                   ^~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1364:33: error: '__c4' was not declared in this scope

 1364 |                 else if (__u <= __c4)

      |                                 ^~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1365:19: error: '__x' was not declared in this scope

 1365 |                   __x = 0;

      |                   ^~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1366:33: error: '__c5' was not declared in this scope

 1366 |                 else if (__u <= __c5)

      |                                 ^~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1368:21: error: '__x' was not declared in this scope

 1368 |                     __x = 1;

      |                     ^~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1370:21: error: '__w' was not declared in this scope

 1370 |                     __w = __178;

      |                     ^~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1370:27: error: '__178' was not declared in this scope

 1370 |                     __w = __178;

      |                           ^~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1376:46: error: '__2cx' was not declared in this scope

 1376 |                                      + __v * __2cx / __param._M_d;

      |                                              ^~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1377:21: error: '__x' was not declared in this scope; did you mean '__y'?

 1377 |                     __x = std::ceil(__y);

      |                     ^~~

      |                     __y

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1378:21: error: '__w' was not declared in this scope; did you mean '__y'?

 1378 |                     __w = -__param._M_d * __param._M_1cx * (1 + __y / 2);

      |                     ^~~

      |                     __y

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1381:17: error: '__reject' was not declared in this scope; did you mean '_reent'?

 1381 |                 __reject = (__w - __e - __x * __param._M_lm_thr

      |                 ^~~~~~~~

      |                 _reent

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1381:29: error: '__w' was not declared in this scope

 1381 |                 __reject = (__w - __e - __x * __param._M_lm_thr

      |                             ^~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1381:35: error: '__e' was not declared in this scope

 1381 |                 __reject = (__w - __e - __x * __param._M_lm_thr

      |                                   ^~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1381:41: error: '__x' was not declared in this scope

 1381 |                 __reject = (__w - __e - __x * __param._M_lm_thr

      |                                         ^~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1382:66: error: '__m' was not declared in this scope; did you mean '__tm'?

 1382 |                             > __param._M_lfm - std::lgamma(__x + __m + 1));

      |                                                                  ^~~

      |                                                                  __tm

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1384:42: error: '__thr' was not declared in this scope

 1384 |                 __reject |= __x + __m >= __thr;

      |                                          ^~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc: At global scope:

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1386:17: error: expected unqualified-id before 'while'

 1386 |               } while (__reject);

      |                 ^~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1388:13: error: expected unqualified-id before 'return'

 1388 |             return result_type(__x + __m + __naf);

      |             ^~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1390:9: error: expected unqualified-id before 'else'

 1390 |         else

      |         ^~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1405:7: error: expected declaration before '}' token

 1405 |       }

      |       ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1411:7: error: too many template-parameter-lists

 1411 |       poisson_distribution<_IntType>::

      |       ^~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1426:22: error: 'poisson_distribution' does not name a type

 1426 |                const poisson_distribution<_IntType>& __x)

      |                      ^~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1426:42: error: expected ',' or '...' before '<' token

 1426 |                const poisson_distribution<_IntType>& __x)

      |                                          ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc: In function 'std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>&, int)':

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1428:35: error: expected nested-name-specifier before 'basic_ostream'

 1428 |       using __ios_base = typename basic_ostream<_CharT, _Traits>::ios_base;

      |                                   ^~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1430:7: error: expected primary-expression before 'const'

 1430 |       const typename __ios_base::fmtflags __flags = __os.flags();

      |       ^~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1434:18: error: '__ios_base' has not been declared

 1434 |       __os.flags(__ios_base::scientific | __ios_base::left);

      |                  ^~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1434:43: error: '__ios_base' has not been declared

 1434 |       __os.flags(__ios_base::scientific | __ios_base::left);

      |                                           ^~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1438:15: error: '__x' was not declared in this scope

 1438 |       __os << __x.mean() << __space << __x._M_nd;

      |               ^~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1440:18: error: '__flags' was not declared in this scope

 1440 |       __os.flags(__flags);

      |                  ^~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc: At global scope:

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1450:16: error: 'poisson_distribution' has not been declared

 1450 |                poisson_distribution<_IntType>& __x)

      |                ^~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1450:36: error: expected ',' or '...' before '<' token

 1450 |                poisson_distribution<_IntType>& __x)

      |                                    ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc: In function 'std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>&, int)':

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1452:35: error: expected nested-name-specifier before 'poisson_distribution'

 1452 |       using param_type = typename poisson_distribution<_IntType>::param_type;

      |                                   ^~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1453:35: error: expected nested-name-specifier before 'basic_istream'

 1453 |       using __ios_base = typename basic_istream<_CharT, _Traits>::ios_base;

      |                                   ^~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1455:7: error: expected primary-expression before 'const'

 1455 |       const typename __ios_base::fmtflags __flags = __is.flags();

      |       ^~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1456:18: error: '__ios_base' has not been declared

 1456 |       __is.flags(__ios_base::skipws);

      |                  ^~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1459:29: error: '__x' was not declared in this scope

 1459 |       if (__is >> __mean >> __x._M_nd)

      |                             ^~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1462:18: error: '__flags' was not declared in this scope

 1462 |       __is.flags(__flags);

      |                  ^~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc: At global scope:

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1469:26: error: expected initializer before '<' token

 1469 |     binomial_distribution<_IntType>::param_type::

      |                          ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1521:16: error: expected nested-name-specifier before 'binomial_distribution'

 1521 |       typename binomial_distribution<_IntType>::result_type

      |                ^~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1521:16: error: too many template-parameter-lists

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1556:16: error: expected nested-name-specifier before 'binomial_distribution'

 1556 |       typename binomial_distribution<_IntType>::result_type

      |                ^~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1556:16: error: too many template-parameter-lists

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1677:7: error: too many template-parameter-lists

 1677 |       binomial_distribution<_IntType>::

      |       ^~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1692:22: error: 'binomial_distribution' does not name a type

 1692 |                const binomial_distribution<_IntType>& __x)

      |                      ^~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1692:43: error: expected ',' or '...' before '<' token

 1692 |                const binomial_distribution<_IntType>& __x)

      |                                           ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1691:5: error: redefinition of 'template<class _IntType, class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>&, int)'

 1691 |     operator<<(std::basic_ostream<_CharT, _Traits>& __os,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1425:5: note: 'template<class _IntType, class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>&, int)' previously declared here

 1425 |     operator<<(std::basic_ostream<_CharT, _Traits>& __os,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1717:16: error: 'binomial_distribution' has not been declared

 1717 |                binomial_distribution<_IntType>& __x)

      |                ^~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1717:37: error: expected ',' or '...' before '<' token

 1717 |                binomial_distribution<_IntType>& __x)

      |                                     ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1716:5: error: redefinition of 'template<class _IntType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>&, int)'

 1716 |     operator>>(std::basic_istream<_CharT, _Traits>& __is,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1449:5: note: 'template<class _IntType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>&, int)' previously declared here

 1449 |     operator>>(std::basic_istream<_CharT, _Traits>& __is,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1754:22: error: 'exponential_distribution' does not name a type

 1754 |                const exponential_distribution<_RealType>& __x)

      |                      ^~~~~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1754:46: error: expected ',' or '...' before '<' token

 1754 |                const exponential_distribution<_RealType>& __x)

      |                                              ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1753:5: error: redefinition of 'template<class _RealType, class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>&, int)'

 1753 |     operator<<(std::basic_ostream<_CharT, _Traits>& __os,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1425:5: note: 'template<class _IntType, class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>&, int)' previously declared here

 1425 |     operator<<(std::basic_ostream<_CharT, _Traits>& __os,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1776:16: error: 'exponential_distribution' has not been declared

 1776 |                exponential_distribution<_RealType>& __x)

      |                ^~~~~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1776:40: error: expected ',' or '...' before '<' token

 1776 |                exponential_distribution<_RealType>& __x)

      |                                        ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1775:5: error: redefinition of 'template<class _RealType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>&, int)'

 1775 |     operator>>(std::basic_istream<_CharT, _Traits>& __is,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1449:5: note: 'template<class _IntType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>&, int)' previously declared here

 1449 |     operator>>(std::basic_istream<_CharT, _Traits>& __is,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1802:16: error: expected nested-name-specifier before 'normal_distribution'

 1802 |       typename normal_distribution<_RealType>::result_type

      |                ^~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1802:16: error: too many template-parameter-lists

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1841:7: error: too many template-parameter-lists

 1841 |       normal_distribution<_RealType>::

      |       ^~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1920:22: error: 'normal_distribution' does not name a type

 1920 |                const normal_distribution<_RealType>& __x)

      |                      ^~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1920:41: error: expected ',' or '...' before '<' token

 1920 |                const normal_distribution<_RealType>& __x)

      |                                         ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1919:5: error: redefinition of 'template<class _RealType, class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>&, int)'

 1919 |     operator<<(std::basic_ostream<_CharT, _Traits>& __os,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1425:5: note: 'template<class _IntType, class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>&, int)' previously declared here

 1425 |     operator<<(std::basic_ostream<_CharT, _Traits>& __os,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1946:16: error: 'normal_distribution' has not been declared

 1946 |                normal_distribution<_RealType>& __x)

      |                ^~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1946:35: error: expected ',' or '...' before '<' token

 1946 |                normal_distribution<_RealType>& __x)

      |                                   ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1945:5: error: redefinition of 'template<class _RealType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>&, int)'

 1945 |     operator>>(std::basic_istream<_CharT, _Traits>& __is,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1449:5: note: 'template<class _IntType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>&, int)' previously declared here

 1449 |     operator>>(std::basic_istream<_CharT, _Traits>& __is,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1974:7: error: too many template-parameter-lists

 1974 |       lognormal_distribution<_RealType>::

      |       ^~~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1987:22: error: 'lognormal_distribution' does not name a type

 1987 |                const lognormal_distribution<_RealType>& __x)

      |                      ^~~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1987:44: error: expected ',' or '...' before '<' token

 1987 |                const lognormal_distribution<_RealType>& __x)

      |                                            ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1986:5: error: redefinition of 'template<class _RealType, class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>&, int)'

 1986 |     operator<<(std::basic_ostream<_CharT, _Traits>& __os,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1425:5: note: 'template<class _IntType, class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>&, int)' previously declared here

 1425 |     operator<<(std::basic_ostream<_CharT, _Traits>& __os,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2011:16: error: 'lognormal_distribution' has not been declared

 2011 |                lognormal_distribution<_RealType>& __x)

      |                ^~~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2011:38: error: expected ',' or '...' before '<' token

 2011 |                lognormal_distribution<_RealType>& __x)

      |                                      ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2010:5: error: redefinition of 'template<class _RealType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>&, int)'

 2010 |     operator>>(std::basic_istream<_CharT, _Traits>& __is,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1449:5: note: 'template<class _IntType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>&, int)' previously declared here

 1449 |     operator>>(std::basic_istream<_CharT, _Traits>& __is,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2059:22: error: 'chi_squared_distribution' does not name a type

 2059 |                const chi_squared_distribution<_RealType>& __x)

      |                      ^~~~~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2059:46: error: expected ',' or '...' before '<' token

 2059 |                const chi_squared_distribution<_RealType>& __x)

      |                                              ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2058:5: error: redefinition of 'template<class _RealType, class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>&, int)'

 2058 |     operator<<(std::basic_ostream<_CharT, _Traits>& __os,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1425:5: note: 'template<class _IntType, class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>&, int)' previously declared here

 1425 |     operator<<(std::basic_ostream<_CharT, _Traits>& __os,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2082:16: error: 'chi_squared_distribution' has not been declared

 2082 |                chi_squared_distribution<_RealType>& __x)

      |                ^~~~~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2082:40: error: expected ',' or '...' before '<' token

 2082 |                chi_squared_distribution<_RealType>& __x)

      |                                        ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2081:5: error: redefinition of 'template<class _RealType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>&, int)'

 2081 |     operator>>(std::basic_istream<_CharT, _Traits>& __is,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1449:5: note: 'template<class _IntType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>&, int)' previously declared here

 1449 |     operator>>(std::basic_istream<_CharT, _Traits>& __is,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2102:16: error: expected nested-name-specifier before 'cauchy_distribution'

 2102 |       typename cauchy_distribution<_RealType>::result_type

      |                ^~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2102:16: error: too many template-parameter-lists

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2122:7: error: too many template-parameter-lists

 2122 |       cauchy_distribution<_RealType>::

      |       ^~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2145:22: error: 'cauchy_distribution' does not name a type

 2145 |                const cauchy_distribution<_RealType>& __x)

      |                      ^~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2145:41: error: expected ',' or '...' before '<' token

 2145 |                const cauchy_distribution<_RealType>& __x)

      |                                         ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2144:5: error: redefinition of 'template<class _RealType, class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>&, int)'

 2144 |     operator<<(std::basic_ostream<_CharT, _Traits>& __os,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1425:5: note: 'template<class _IntType, class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>&, int)' previously declared here

 1425 |     operator<<(std::basic_ostream<_CharT, _Traits>& __os,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2168:16: error: 'cauchy_distribution' has not been declared

 2168 |                cauchy_distribution<_RealType>& __x)

      |                ^~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2168:35: error: expected ',' or '...' before '<' token

 2168 |                cauchy_distribution<_RealType>& __x)

      |                                   ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2167:5: error: redefinition of 'template<class _RealType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>&, int)'

 2167 |     operator>>(std::basic_istream<_CharT, _Traits>& __is,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1449:5: note: 'template<class _IntType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>&, int)' previously declared here

 1449 |     operator>>(std::basic_istream<_CharT, _Traits>& __is,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2220:22: error: 'fisher_f_distribution' does not name a type

 2220 |                const fisher_f_distribution<_RealType>& __x)

      |                      ^~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2220:43: error: expected ',' or '...' before '<' token

 2220 |                const fisher_f_distribution<_RealType>& __x)

      |                                           ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2219:5: error: redefinition of 'template<class _RealType, class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>&, int)'

 2219 |     operator<<(std::basic_ostream<_CharT, _Traits>& __os,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1425:5: note: 'template<class _IntType, class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>&, int)' previously declared here

 1425 |     operator<<(std::basic_ostream<_CharT, _Traits>& __os,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2244:16: error: 'fisher_f_distribution' has not been declared

 2244 |                fisher_f_distribution<_RealType>& __x)

      |                ^~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2244:37: error: expected ',' or '...' before '<' token

 2244 |                fisher_f_distribution<_RealType>& __x)

      |                                     ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2243:5: error: redefinition of 'template<class _RealType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>&, int)'

 2243 |     operator>>(std::basic_istream<_CharT, _Traits>& __is,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1449:5: note: 'template<class _IntType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>&, int)' previously declared here

 1449 |     operator>>(std::basic_istream<_CharT, _Traits>& __is,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2294:22: error: 'student_t_distribution' does not name a type

 2294 |                const student_t_distribution<_RealType>& __x)

      |                      ^~~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2294:44: error: expected ',' or '...' before '<' token

 2294 |                const student_t_distribution<_RealType>& __x)

      |                                            ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2293:5: error: redefinition of 'template<class _RealType, class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>&, int)'

 2293 |     operator<<(std::basic_ostream<_CharT, _Traits>& __os,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1425:5: note: 'template<class _IntType, class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>&, int)' previously declared here

 1425 |     operator<<(std::basic_ostream<_CharT, _Traits>& __os,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2317:16: error: 'student_t_distribution' has not been declared

 2317 |                student_t_distribution<_RealType>& __x)

      |                ^~~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2317:38: error: expected ',' or '...' before '<' token

 2317 |                student_t_distribution<_RealType>& __x)

      |                                      ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2316:5: error: redefinition of 'template<class _RealType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>&, int)'

 2316 |     operator>>(std::basic_istream<_CharT, _Traits>& __is,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1449:5: note: 'template<class _IntType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>&, int)' previously declared here

 1449 |     operator>>(std::basic_istream<_CharT, _Traits>& __is,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2337:23: error: expected initializer before '<' token

 2337 |     gamma_distribution<_RealType>::param_type::

      |                       ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2353:16: error: expected nested-name-specifier before 'gamma_distribution'

 2353 |       typename gamma_distribution<_RealType>::result_type

      |                ^~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2353:16: error: too many template-parameter-lists

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2398:7: error: too many template-parameter-lists

 2398 |       gamma_distribution<_RealType>::

      |       ^~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2463:22: error: 'gamma_distribution' does not name a type

 2463 |                const gamma_distribution<_RealType>& __x)

      |                      ^~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2463:40: error: expected ',' or '...' before '<' token

 2463 |                const gamma_distribution<_RealType>& __x)

      |                                        ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2462:5: error: redefinition of 'template<class _RealType, class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>&, int)'

 2462 |     operator<<(std::basic_ostream<_CharT, _Traits>& __os,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1425:5: note: 'template<class _IntType, class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>&, int)' previously declared here

 1425 |     operator<<(std::basic_ostream<_CharT, _Traits>& __os,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2487:16: error: 'gamma_distribution' has not been declared

 2487 |                gamma_distribution<_RealType>& __x)

      |                ^~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2487:34: error: expected ',' or '...' before '<' token

 2487 |                gamma_distribution<_RealType>& __x)

      |                                  ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2486:5: error: redefinition of 'template<class _RealType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>&, int)'

 2486 |     operator>>(std::basic_istream<_CharT, _Traits>& __is,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1449:5: note: 'template<class _IntType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>&, int)' previously declared here

 1449 |     operator>>(std::basic_istream<_CharT, _Traits>& __is,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2506:16: error: expected nested-name-specifier before 'weibull_distribution'

 2506 |       typename weibull_distribution<_RealType>::result_type

      |                ^~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2506:16: error: too many template-parameter-lists

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2521:7: error: too many template-parameter-lists

 2521 |       weibull_distribution<_RealType>::

      |       ^~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2539:22: error: 'weibull_distribution' does not name a type

 2539 |                const weibull_distribution<_RealType>& __x)

      |                      ^~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2539:42: error: expected ',' or '...' before '<' token

 2539 |                const weibull_distribution<_RealType>& __x)

      |                                          ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2538:5: error: redefinition of 'template<class _RealType, class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>&, int)'

 2538 |     operator<<(std::basic_ostream<_CharT, _Traits>& __os,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1425:5: note: 'template<class _IntType, class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>&, int)' previously declared here

 1425 |     operator<<(std::basic_ostream<_CharT, _Traits>& __os,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2562:16: error: 'weibull_distribution' has not been declared

 2562 |                weibull_distribution<_RealType>& __x)

      |                ^~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2562:36: error: expected ',' or '...' before '<' token

 2562 |                weibull_distribution<_RealType>& __x)

      |                                    ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2561:5: error: redefinition of 'template<class _RealType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>&, int)'

 2561 |     operator>>(std::basic_istream<_CharT, _Traits>& __is,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1449:5: note: 'template<class _IntType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>&, int)' previously declared here

 1449 |     operator>>(std::basic_istream<_CharT, _Traits>& __is,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2581:16: error: expected nested-name-specifier before 'extreme_value_distribution'

 2581 |       typename extreme_value_distribution<_RealType>::result_type

      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2581:16: error: too many template-parameter-lists

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2596:7: error: too many template-parameter-lists

 2596 |       extreme_value_distribution<_RealType>::

      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2613:22: error: 'extreme_value_distribution' does not name a type

 2613 |                const extreme_value_distribution<_RealType>& __x)

      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2613:48: error: expected ',' or '...' before '<' token

 2613 |                const extreme_value_distribution<_RealType>& __x)

      |                                                ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2612:5: error: redefinition of 'template<class _RealType, class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>&, int)'

 2612 |     operator<<(std::basic_ostream<_CharT, _Traits>& __os,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1425:5: note: 'template<class _IntType, class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>&, int)' previously declared here

 1425 |     operator<<(std::basic_ostream<_CharT, _Traits>& __os,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2636:16: error: 'extreme_value_distribution' has not been declared

 2636 |                extreme_value_distribution<_RealType>& __x)

      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2636:42: error: expected ',' or '...' before '<' token

 2636 |                extreme_value_distribution<_RealType>& __x)

      |                                          ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2635:5: error: redefinition of 'template<class _RealType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>&, int)'

 2635 |     operator>>(std::basic_istream<_CharT, _Traits>& __is,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1449:5: note: 'template<class _IntType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>&, int)' previously declared here

 1449 |     operator>>(std::basic_istream<_CharT, _Traits>& __is,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2656:26: error: expected initializer before '<' token

 2656 |     discrete_distribution<_IntType>::param_type::

      |                          ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2681:7: error: 'discrete_distribution' does not name a type

 2681 |       discrete_distribution<_IntType>::param_type::

      |       ^~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2697:16: error: expected nested-name-specifier before 'discrete_distribution'

 2697 |       typename discrete_distribution<_IntType>::result_type

      |                ^~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2697:16: error: too many template-parameter-lists

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2719:7: error: too many template-parameter-lists

 2719 |       discrete_distribution<_IntType>::

      |       ^~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2749:22: error: 'discrete_distribution' does not name a type

 2749 |                const discrete_distribution<_IntType>& __x)

      |                      ^~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2749:43: error: expected ',' or '...' before '<' token

 2749 |                const discrete_distribution<_IntType>& __x)

      |                                           ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2748:5: error: redefinition of 'template<class _IntType, class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>&, int)'

 2748 |     operator<<(std::basic_ostream<_CharT, _Traits>& __os,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1425:5: note: 'template<class _IntType, class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>&, int)' previously declared here

 1425 |     operator<<(std::basic_ostream<_CharT, _Traits>& __os,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2775:5: error: 'basic_istream' does not name a type

 2775 |     basic_istream<_CharT, _Traits>&

      |     ^~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2795:16: error: 'discrete_distribution' has not been declared

 2795 |                discrete_distribution<_IntType>& __x)

      |                ^~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2795:37: error: expected ',' or '...' before '<' token

 2795 |                discrete_distribution<_IntType>& __x)

      |                                     ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2794:5: error: redefinition of 'template<class _IntType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>&, int)'

 2794 |     operator>>(std::basic_istream<_CharT, _Traits>& __is,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1449:5: note: 'template<class _IntType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>&, int)' previously declared here

 1449 |     operator>>(std::basic_istream<_CharT, _Traits>& __is,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2817:36: error: expected initializer before '<' token

 2817 |     piecewise_constant_distribution<_RealType>::param_type::

      |                                    ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2850:7: error: 'piecewise_constant_distribution' does not name a type

 2850 |       piecewise_constant_distribution<_RealType>::param_type::

      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2875:7: error: 'piecewise_constant_distribution' does not name a type

 2875 |       piecewise_constant_distribution<_RealType>::param_type::

      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2892:7: error: 'piecewise_constant_distribution' does not name a type

 2892 |       piecewise_constant_distribution<_RealType>::param_type::

      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2912:16: error: expected nested-name-specifier before 'piecewise_constant_distribution'

 2912 |       typename piecewise_constant_distribution<_RealType>::result_type

      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2912:16: error: too many template-parameter-lists

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2937:7: error: too many template-parameter-lists

 2937 |       piecewise_constant_distribution<_RealType>::

      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2971:22: error: 'piecewise_constant_distribution' does not name a type

 2971 |                const piecewise_constant_distribution<_RealType>& __x)

      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2971:53: error: expected ',' or '...' before '<' token

 2971 |                const piecewise_constant_distribution<_RealType>& __x)

      |                                                     ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:2970:5: error: redefinition of 'template<class _RealType, class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>&, int)'

 2970 |     operator<<(std::basic_ostream<_CharT, _Traits>& __os,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1425:5: note: 'template<class _IntType, class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>&, int)' previously declared here

 1425 |     operator<<(std::basic_ostream<_CharT, _Traits>& __os,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:3002:16: error: 'piecewise_constant_distribution' has not been declared

 3002 |                piecewise_constant_distribution<_RealType>& __x)

      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:3002:47: error: expected ',' or '...' before '<' token

 3002 |                piecewise_constant_distribution<_RealType>& __x)

      |                                               ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:3001:5: error: redefinition of 'template<class _RealType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>&, int)'

 3001 |     operator>>(std::basic_istream<_CharT, _Traits>& __is,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1449:5: note: 'template<class _IntType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>&, int)' previously declared here

 1449 |     operator>>(std::basic_istream<_CharT, _Traits>& __is,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:3031:34: error: expected initializer before '<' token

 3031 |     piecewise_linear_distribution<_RealType>::param_type::

      |                                  ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:3071:7: error: 'piecewise_linear_distribution' does not name a type

 3071 |       piecewise_linear_distribution<_RealType>::param_type::

      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:3088:7: error: 'piecewise_linear_distribution' does not name a type

 3088 |       piecewise_linear_distribution<_RealType>::param_type::

      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:3105:7: error: 'piecewise_linear_distribution' does not name a type

 3105 |       piecewise_linear_distribution<_RealType>::param_type::

      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:3125:16: error: expected nested-name-specifier before 'piecewise_linear_distribution'

 3125 |       typename piecewise_linear_distribution<_RealType>::result_type

      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:3125:16: error: too many template-parameter-lists

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:3163:7: error: too many template-parameter-lists

 3163 |       piecewise_linear_distribution<_RealType>::

      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:3177:22: error: 'piecewise_linear_distribution' does not name a type

 3177 |                const piecewise_linear_distribution<_RealType>& __x)

      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:3177:51: error: expected ',' or '...' before '<' token

 3177 |                const piecewise_linear_distribution<_RealType>& __x)

      |                                                   ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:3176:5: error: redefinition of 'template<class _RealType, class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>&, int)'

 3176 |     operator<<(std::basic_ostream<_CharT, _Traits>& __os,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1425:5: note: 'template<class _IntType, class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>&, int)' previously declared here

 1425 |     operator<<(std::basic_ostream<_CharT, _Traits>& __os,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:3208:16: error: 'piecewise_linear_distribution' has not been declared

 3208 |                piecewise_linear_distribution<_RealType>& __x)

      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:3208:45: error: expected ',' or '...' before '<' token

 3208 |                piecewise_linear_distribution<_RealType>& __x)

      |                                             ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:3207:5: error: redefinition of 'template<class _RealType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>&, int)'

 3207 |     operator>>(std::basic_istream<_CharT, _Traits>& __is,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:1449:5: note: 'template<class _IntType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>&, int)' previously declared here

 1449 |     operator>>(std::basic_istream<_CharT, _Traits>& __is,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:3235:5: error: 'seed_seq' does not name a type

 3235 |     seed_seq::seed_seq(std::initializer_list<_IntType> __il)

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:3244:5: error: 'seed_seq' does not name a type

 3244 |     seed_seq::seed_seq(_InputIterator __begin, _InputIterator __end)

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:3256:5: error: 'seed_seq' has not been declared

 3256 |     seed_seq::generate(_RandomAccessIterator __begin,

      |     ^~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc: In function 'void generate(_RandomAccessIterator, _RandomAccessIterator)':

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:3259:24: error: expected nested-name-specifier before 'iterator_traits'

 3259 |       typedef typename iterator_traits<_RandomAccessIterator>::value_type

      |                        ^~~~~~~~~~~~~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:3259:39: error: expected initializer before '<' token

 3259 |       typedef typename iterator_traits<_RandomAccessIterator>::value_type

      |                                       ^

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:3268:26: error: '_M_v' was not declared in this scope

 3268 |       const size_t __s = _M_v.size();

      |                          ^~~~

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc: At global scope:

c:\t_drive\arduino-1.8.19\hardware\tools\arm\arm-none-eabi\include\c++\11.3.1\bits\random.tcc:3383:1: error: expected declaration before '}' token

 3383 | } // namespace

      | ^

Error compiling for board Teensy 4.0.
 
Seems to be the usual clash with the arduino #defines for abs, round etc. Try to #undef them. IIRC mjs513 already has a PR removing those #defines from the core

Edit: Here it is: https://github.com/PaulStoffregen/cores/pull/655

THANKS @luni! - Indeed it was and using that <PR> file fixed it!

Seeing this to test including @Nominal Animal:
Code:
C:\T_Drive\tCode\RANDOM\CppMT19937\CppMT19937.ino May 13 2023 11:56:26
us for 1M prng_u32()'s = 18335
us for 1M myRandomGenerator()'s = 47831
us for [B][COLOR="#FF0000"]1K[/COLOR][/B] Entropy.random()'s = 3264105
prng:	CD93179A Large	3448969114
myRG:	5B7D1E40 Small

From this sketch:
Code:
// https://forum.pjrc.com/threads/72788-random()
// https://www.geeksforgeeks.org/stdmt19937-class-in-cpp/

#include <random>
using namespace std;
std::mt19937 myRandomGenerator(millis()); // the generator needs some seed value

#include <Entropy.h>
uint64_t  prng_state;

uint32_t  prng_u32(void)
{
  uint64_t  x = prng_state;
  x ^= x >> 12;
  x ^= x << 25;
  x ^= x >> 27;
  prng_state = x;
  return (x * UINT64_C(2685821657736338717)) >> 32;
}

void setup()
{
  Entropy.Initialize();
  while (!Serial && millis() < 2500 );
  Serial.println("\n" __FILE__ " " __DATE__ " " __TIME__);

  prng_state = Entropy.random();
  do {
    prng_state = (prng_state << 32) | Entropy.random();
  } while (!prng_state);
  uint32_t dt = micros();
  for ( int ii=0; ii<1000000; ii++) prng_u32();
  dt = micros()-dt;
  Serial.print("us for 1M prng_u32()'s = ");
  Serial.println(dt);
  dt = micros();
  for ( int ii=0; ii<1000000; ii++) myRandomGenerator();
  dt = micros()-dt;
  Serial.print("us for 1M myRandomGenerator()'s = ");
  Serial.println(dt);
  dt = micros();
  for ( int ii=0; ii<1000; ii++) Entropy.random();
  dt = micros()-dt;
  Serial.print("us for 1K Entropy.random()'s = ");
  Serial.println(dt);
}

void loop()
{
  uint32_t r =  prng_u32();  // generate a new random number
  Serial.printf("prng:\t%08X %s\t%lu\n",r, r > 0x7FFF'FFFF ? "Large" : "Small", r);  // print it in HEX and see if it is larger than 2^31
  r =  myRandomGenerator();  // generate a new random number
  Serial.printf("myRG:\t%08X %s\n", r, r > 0x7FFF'FFFF ? "Large" : "Small");  // print it in HEX and see if it is larger than 2^31
  delay(1000);
}
 
Back
Top