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

Use stringstream to format default values #1215

Merged
merged 1 commit into from
Nov 3, 2023

Conversation

WardBrian
Copy link
Member

Submisison Checklist

  • Run tests: ./runCmdStanTests.py src/test
  • Declare copyright holder and open-source license: see below

Summary:

We use std::to_string to format default values (since #1172) but this does not print floating point numbers in scientific notation when required, see the example on cppreference comparing operator<< and std::to_string

Intended Effect:

Closes #1214

How to Verify:

./bernoulli help-all | grep -E "tol_(obj|grad|param)=<double>" -A 3

Side Effects:

Documentation:

Copyright and Licensing

Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company):

By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses:

Copy link
Member

@mitzimorris mitzimorris left a comment

Choose a reason for hiding this comment

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

lgtm!

@WardBrian WardBrian merged commit 30724d2 into develop Nov 3, 2023
1 check passed
@WardBrian WardBrian deleted the fix/1214-scientific-notation branch November 3, 2023 15:49
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.

Discrepancy between help-all print and defaults: Pathfinder, LBFGS and BFGS
2 participants