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 negative numbers now returns negative values #420

Merged
merged 1 commit into from
Jun 8, 2016

Conversation

jimhester
Copy link
Collaborator

Fixes #308

@@ -100,14 +101,14 @@ inline bool parseNumber(char decimalMark, char groupingMark, Iterator& first,
break;
case STATE_FIN:
last = cur++;
res = sum;
res = negative ? sum * -1 : sum;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this just break so it returns using the same path as below?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could, I guess the only issue is it wouldn't break out of the for loop, so you would iterate through the rest of the string needlessly (probably doesn't matter).

It could be a goto though...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooooh yeah. Let's leave it as is then.

@hadley
Copy link
Member

hadley commented Jun 7, 2016

LGTM

@jimhester jimhester merged commit f3c181a into tidyverse:master Jun 8, 2016
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

Successfully merging this pull request may close these issues.

2 participants