Skip to content

[hist] allow specifying the floating point precision in GetExpFormula#18194

Merged
dpiparo merged 4 commits intoroot-project:masterfrom
ferdymercury:precg
Mar 30, 2025
Merged

[hist] allow specifying the floating point precision in GetExpFormula#18194
dpiparo merged 4 commits intoroot-project:masterfrom
ferdymercury:precg

Conversation

@ferdymercury
Copy link
Copy Markdown
Collaborator

This Pull request:

Changes or fixes:

Fixes #10769

Checklist:

  • tested changes locally
  • updated the docs (if necessary)

@ferdymercury ferdymercury requested a review from lmoneta as a code owner March 29, 2025 13:04
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 29, 2025

Test Results

    18 files      18 suites   5d 2h 0m 29s ⏱️
 2 736 tests  2 735 ✅ 0 💤 1 ❌
47 498 runs  47 497 ✅ 0 💤 1 ❌

For more details on these failures, see this check.

Results for commit da0880e.

♻️ This comment has been updated with latest results.

Copy link
Copy Markdown
Member

@pcanal pcanal left a comment

Choose a reason for hiding this comment

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

Thanks.

@guitargeek guitargeek closed this Mar 29, 2025
@guitargeek guitargeek reopened this Mar 29, 2025
@ferdymercury ferdymercury marked this pull request as draft March 29, 2025 22:53
@ferdymercury ferdymercury marked this pull request as ready for review March 30, 2025 10:59
@ferdymercury ferdymercury requested a review from dpiparo as a code owner March 30, 2025 10:59
[skip-ci] improve docu
@dpiparo dpiparo merged commit 010f624 into root-project:master Mar 30, 2025
19 of 23 checks passed
@ferdymercury ferdymercury deleted the precg branch March 30, 2025 14:54
virtual Int_t GetNpar() const {return fNpar;}
virtual Int_t GetNumber() const {return fNumber;}
virtual TString GetExpFormula(Option_t *option="") const;
virtual TString GetExpFormula(Option_t *option = "", const char *fl_format = "%g") const;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The legacy TFormula class should not be changed anymore. Also, the signature of a virtual function should not be changed lightly, because people might override it, and if the signature doesn't match the override is ineffective. And if they don't use the override keyword to hint to the compiler that it should be an override, they won't even get an error or warning!

guitargeek added a commit to guitargeek/root that referenced this pull request Aug 24, 2025
In root-project#18194, an optional parameter to `TFormula::GetExpFormula()` was
introduced, which can be used to customize the precision when putting
parameters into the jitted code.

However, I don't see the reason why wouldn't like to always print the
floating point numbers with maximum precision, which is suggested in
this commit.

This is achieved using modern C++ functions, which are also not
respecting the users locale setting, but instead use the classic C
locale by default, which is what we need when generating code.

Follows up on root-project#18194 (and its partial revert root-project#18216).

Closes root-project#17225.

Replaces root-project#17327.
guitargeek added a commit that referenced this pull request Aug 26, 2025
In #18194, an optional parameter to `TFormula::GetExpFormula()` was
introduced, which can be used to customize the precision when putting
parameters into the jitted code.

However, I don't see the reason why wouldn't like to always print the
floating point numbers with maximum precision, which is suggested in
this commit.

This is achieved using modern C++ functions, which are also not
respecting the users locale setting, but instead use the classic C
locale by default, which is what we need when generating code.

Follows up on #18194 (and its partial revert #18216).

Closes #17225.

Replaces #17327.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[hist] Use correct rounding for parameters in TFormula::GetExpFormula

4 participants