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

Fix Formatter.floatformat and Object.to_format #1602

Merged
merged 2 commits into from
Nov 6, 2024

Conversation

konimarti
Copy link
Contributor

Fix two minor issues in the stdlib.

Fix the float format specifier in Object.to_format. If there is a float
stored in a Object such as 3.14, it would be printed out as 3 because
the format specifier is %d but should be %g.
Fix floatformat to print 'nan' if float is nan. Currently,
io::printn(float.nan) will produce 'inf' instead of 'nan'.
@lerno
Copy link
Collaborator

lerno commented Nov 6, 2024

Good catches, thank you!

@lerno lerno merged commit b7a095b into c3lang:master Nov 6, 2024
43 checks passed
@konimarti konimarti deleted the fix-format branch November 7, 2024 07:51
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