Skip to content

Pretty float#914

Merged
tautschnig merged 3 commits intomasterfrom
pretty-float
May 16, 2017
Merged

Pretty float#914
tautschnig merged 3 commits intomasterfrom
pretty-float

Conversation

@kroening
Copy link
Collaborator

This PR makes the output of floating-point numbers look more similar to what stdc libraries do

Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it be possible to have a comment explaining the magic number -4?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't actually know where that is from (was there before); and actual implementations appear to be different.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Would you mind adding a comment to that effect? In particular, the fact that actual implementations appear to differ sounds interesting to me.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think I would have implemented this using result.find_last_not_of('0').

Copy link
Collaborator

@tautschnig tautschnig left a comment

Choose a reason for hiding this comment

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

See earlier comments, but the main addition I'd ask for is a regression test covering this code, in particular the newly added e/E formatting.

@tautschnig tautschnig merged commit dffb4ef into master May 16, 2017
@tautschnig tautschnig deleted the pretty-float branch June 19, 2017 21:56
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