libMesh::isfinite() subroutines - #4521
Open
roystgnr wants to merge 9 commits into
Open
Conversation
You'd think std::isfinite would already support std::complex, right? But apparently the idea only got floated once back in 2022, the C++ people want to see it in C _Complex first, and I can't find a C equivalent to the C++ std-proposals mailing list so I'm not sure where it went from there.
Surely they can't blame *this* lacuna on the C people.
Member
Yea agree! |
Fixing our failure to test complex instantiations with Number!=complex uncovered the fact that we didn't actually have test macros that work for Number!=complex
I should probably be less lazy and make something that templates on type and avoids all the "yup, 0i=0i" testing in the real-valued cases, but these are very fast tests anyway.
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.
From idaholab/moose#33439 (comment):
I think it should be a global method so future generic code can use the same
isfinite(foo)and getstd::isfinitevia ausingorlibMesh::isfinitevia ADL, but otherwise I agree.@lindsayad - we should probably be adding
isfiniteto MetaPhysicL too, andisnanhere, don't you think? More urgently the former? I think long ago I got into the habit of usingisnanin cases which in hindsight should have beenisnan20% of the time andisfinite80% of the time, simply because I formed that habit pre-C++11.