-
Notifications
You must be signed in to change notification settings - Fork 342
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
IParser: Use long long int #4046
IParser: Use long long int #4046
Conversation
For this test, https://github.com/WeiqunZhang/amrex-devtests/blob/main/iparser_long/main.cpp
produces
|
We could allow |
0841726
to
9eac969
Compare
4e9fcda
to
af03c0f
Compare
af03c0f
to
7fd3297
Compare
* Use long long int as the underlying integer data type in IParser. * Extend number format to include `3e9`, `2.34e6`, `1'000'000`, etc.
7fd3297
to
76c8aa4
Compare
as a separator for :cpp:`IParser` numbers just like C++ integer | ||
literals. Additionally, a floating point like number with a positive | ||
exponent may be accepted as an integer if it is reasonable to do so. For | ||
example, it's okay to have ``1.234e3``, but ``1.23e2`` is an error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the former reasonable but the latter not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A typo.
#4046 changed the type of IParser from int to long long, however in pp_make_parser it was still cast to int which can cause an overflow.
Use long long int as the underlying integer data type in IParser.
Extend number format to include
3e9
,2.34e6
,1'000'000
, etc.