Skip to content

Fix float parsing #5643

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

Merged
merged 3 commits into from
Mar 31, 2025
Merged

Conversation

coolreader18
Copy link
Member

No description provided.

if re.is_sign_positive() {
return im_part;
} else {
re.to_string()
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
re.to_string()
"0"

or

Suggested change
re.to_string()
"0.0"

?

Calling specifically f64::to_string() only for zero and float::to_string(re) for non-zero looks like a bug or unnecessary

Copy link
Member Author

Choose a reason for hiding this comment

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

This was copied over from the old implementation, but I agree.

Copy link
Member

Choose a reason for hiding this comment

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

oh, sorry!

@youknowone youknowone merged commit 160363f into RustPython:main Mar 31, 2025
11 checks passed
@coolreader18 coolreader18 deleted the fix-float-parsing branch March 31, 2025 05:39
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