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

Parsing floating point numbers with large or small absolute value #126

Open
exogba opened this issue Sep 4, 2024 · 1 comment
Open

Parsing floating point numbers with large or small absolute value #126

exogba opened this issue Sep 4, 2024 · 1 comment

Comments

@exogba
Copy link

exogba commented Sep 4, 2024

When parsing floating point numbers with very small or very large absolute values, the result of the parsing will be an error with error type 'value_out_of_range'.
auto result = scn::scan<float>("2e-1000", "{}"); // result will be an error
auto result = scn::scan<float>("2e1000", "{}"); // result will be an error
My question would be if this is the intended behaviour or not. Scanf for example would succeed in those cases and the resulting values would be 0/inf. And intuitively that is the behaviour I was expecting for scnlib as well.

@nicoheidtke
Copy link

Any opinions on this? @eliaskosunen
I too think a parsing error might not be the best solution.

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