Add set of full-precision UDL#2243
Open
esseivaju wants to merge 1 commit intoceleritas-project:developfrom
Open
Add set of full-precision UDL#2243esseivaju wants to merge 1 commit intoceleritas-project:developfrom
esseivaju wants to merge 1 commit intoceleritas-project:developfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2243 +/- ##
=========================================
Coverage 86.87% 86.87%
=========================================
Files 1331 1331
Lines 42102 42102
Branches 12951 13405 +454
=========================================
Hits 36578 36578
- Misses 4319 4508 +189
+ Partials 1205 1016 -189
🚀 New features to boost your workflow:
|
Test summary 5 913 files 9 451 suites 18m 26s ⏱️ Results for commit 9fee262. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Following-up discussions in #2235
This update should improve the previously introduced UDL to meet the requirements stated in Constants.hh. floating-point udl will now by default perform operation in, and return
real_type, avoiding accidental promotion such as in2.5_cm * floatwhich would previously promote to double.For cases where we'd still like full-precision, introduce an extra set of udl with a
_fpsuffix returning aConstant. This setup should meet the two requirements, preventing accidental promotion, while still allowing explicit full-precision as needed with minimal boilerplate in user code.Note that there is a small difference compared to before, where
2.5 * units::cm * runtime_floatwas performed in, and returned double precision regardless ofCELERITAS_REAL_TYPE, now2.5_cm * runtime_floatmatchesreal_type