-
Notifications
You must be signed in to change notification settings - Fork 182
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
implemented clip function #355
Conversation
This comment has been minimized.
This comment has been minimized.
ebe924a
to
ba0b259
Compare
Thanks @aman-godara. Please write your questions and comments in the issue thread (here) instead of the source code. |
I have created the 7 functions as requested in #319 (comment) i.e. there is a function for each of the Now for my query consider a case where |
ba0b259
to
83d0df8
Compare
It won't be handled automatically. You'd need to write specific functions for each combination of types and kinds. For integer variants that would be 4^3 = 64 specific functions and for real variants that would be 3^3 = 27 specific functions. And it gets worse if you want to do something like I don't think it's worth it. Let's simply require all three arguments to be of the same type and kind. |
Note that you haven't included the new module with the CMake build system yet: Lines 3 to 5 in 8a5f3d4
As well as the manual Makefiles here: Lines 1 to 2 in 8a5f3d4
The module will not be preprocessed and compiled with the current setup. |
Should I write some validation check in the function to ensure that user gets a warning whenever same type and same kind condition is violated OR will fortran throw an error automatically? |
There will be a compile-time error. |
9136fe5
to
477864a
Compare
477864a
to
2608434
Compare
Should I continue to submit Let me make some updates to demonstrate what I am proposing. |
f586e6f
to
554f301
Compare
…ts.txt and Makefile.manual of tests directory
f8b69c9
to
1b0d0a5
Compare
1b0d0a5
to
243ac91
Compare
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few minor suggestions, but otherwise looks good to me.
…ath.md Co-authored-by: Ivan Pribec <[email protected]>
Looking at the test_math.f90 in more detail now, I'm confused why you chose to wrap calls to
and then the same exact subroutine for other type kinds. Then you do
But why not just do
and get rid of the unnecessary boilerplate? Further, you can now do:
which will print a helpful message (while not stopping the program) if some of the tests fail. |
…mpare with answer, improved test_math.f90
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is good to go, thank you Aman and reviewers!
We still need one more approval to merge this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to get merged.
Thank you @aman-godara and reviewers! |
Status: Code written is open for review
Regarding: #319
Provided Specifications: checkout #319 (comment)
Status:
clip
function instdlib_math.fypp
fileclip
function intest_stdlib_math.f90
file (this.f90
file was created usingfypp
preprocessor fromtest_math.fypp
file)clip
function in newly createdstdlib_math.md
file.