Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Welcome to tinyexpr-plusplus Discussions! #9

Discussion options

👋 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.
You must be logged in to vote

Replies: 3 comments

Comment options

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!

You must be logged in to vote
0 replies
Comment options

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.

You must be logged in to vote
0 replies
Comment options

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.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /