-
Notifications
You must be signed in to change notification settings - Fork 15
Welcome to tinyexpr-plusplus Discussions! #9
-
👋 Welcome!
We’re using Discussions as a place to connect with other members of our community. We hope that you:
- Ask questions you’re wondering about.
- Share ideas.
- Engage with other community members.
- Welcome others and are open-minded.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 3 comments
-
Hi @Blake-Madden , thank you so much for creating an advanced version of Tinyexpr. I compared it to other libs and it has more and better features. Want to let you know that I'm using it successfully with Arduino Framework, but I had to downgrade the random generator since ESP32 microcontrollers don't support the entropy device. It would be nice whether you could define a condition to disable it. This is my patch:
static te_type te_random() { // std::random_device rdev; // std::mt19937 gen(rdev()); // std::uniform_real_distribution<te_type> distr(0, 1); // return distr(gen); return (double) rand() / RAND_MAX; // Generate a random double between 0 and 1 }
Cheers!
Beta Was this translation helpful? Give feedback.
All reactions
-
Of course, and thanks for the research on this. I'll wrap the mersenne twister code in one define
block and an alternative rand()
branch in another define
block.
I'll seed rand()
with time; let me know if that would be a problem.
I'll try to get to this this weekend.
Beta Was this translation helpful? Give feedback.
All reactions
-
I just checked in a change. If you define TE_RAND_SEED_TIME
then it will use time
instead of std::random_device
. Let me know if this works OK with your platform.
Beta Was this translation helpful? Give feedback.