Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to use a wider data type than float with expr_eval()? #2

Open
dipanjan opened this issue Dec 3, 2017 · 1 comment
Open

Comments

@dipanjan
Copy link

dipanjan commented Dec 3, 2017

Looks like the return type of expr_eval() is float which is 32 bit wide on my 64 bit system. Is it possible to use double which is of 64 bits while evaluating an expression?

@zserge
Copy link
Owner

zserge commented Dec 3, 2017

Well, expr.h is a single-header library, so you can probably copy it and find/replace all float with double to make it work.

Alternatively, you may replace float with some expr_num_t where appropriate. It would allow you to redefine expr_num_t as double if needed, or any other implementation like fixed-point C++ class with overloaded operators. I haven't thought that far, but I think it might be convenient in some cases.

If you decide to go with expr_num_t way - may I ask you to do a pull request then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants