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

Revert change to %t default precision #22796

Merged

Conversation

jeremiah-corrado
Copy link
Contributor

@jeremiah-corrado jeremiah-corrado commented Jul 21, 2023

The default floating point precision style for %t was accidentally changed in #22766. This PR reverts that change.

Also fixes .good files for compflags/TestWarnUnstableSuppression, which was failing on main.

  • paratest

@jeremiah-corrado jeremiah-corrado merged commit ee9974b into chapel-lang:main Jul 21, 2023
7 checks passed
@jeremiah-corrado jeremiah-corrado deleted the fix-pcnt-t-precision-change branch July 21, 2023 21:33
@@ -5013,7 +5013,7 @@ qioerr qio_conv_parse(c_string fmt,
} else if( specifier == 't' ) {
style_out->base = 10;
style_out->pad_char = ' ';
style_out->realfmt = 0;
style_out->realfmt = 2;
Copy link
Member

Choose a reason for hiding this comment

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

Just checking: should the same change be applied to %? -- in other words, was it decided that it should use a different precision from %t or was that accidental as well?

Copy link
Contributor Author

@jeremiah-corrado jeremiah-corrado Jul 26, 2023

Choose a reason for hiding this comment

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

My understanding was that %t setting style_out->realfmt=2 was a bug in the sense that it was a deviation from the default format. But now that it's deprecated, we should leave the bug in and use the %t -> %? transition as an avenue to move to the correct behavior.

In other words, with %?, I think we really want all of the following to be equivalent (as should have been the case for %t AFAIK):

writef("%?", myArrayOfReals);
write(myArrayOfReals);
stdout.withSerializer(DefaultSerializer).writef("%?", myArrayOfReals);
stdout.withSerializer(DefaultSerializer).write(myArrayOfReals);

Does this agree with your understanding? (I'm also game to have a discussion about this with the IO subteam if you think there might be any doubt about what we should do here).

Copy link
Member

Choose a reason for hiding this comment

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

Works for me. No real opinion from me on this point; I was just checking it was intentional, and it was.

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