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
Add a Remainder method #44
Conversation
Sounds good to me. Not sure how to implement it at first glance tho. Would recommend looking at DirectXMath source code for inspiration |
Can you modify the test to follow the format of the other ones (no output)? And add a little more test data. Some normal inputs, NaN, ±infinity etc |
Sure, the output was mostly to make sure everything is actually working properly. |
Currently there seems to be issues related to precision which result in weird unexpected results for higher values. I'll have to trace down the actual CLR implementation of |
Ready for another review.
|
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.
Appears good to me. Reviewing it from my CS class but I think its thorough enough
Adds a vectorized remainder method that mirrors the C# implementation (not the IEEE one).
Also adds a
Truncate
method which rounds towards zero unlike the currentRound
method which rounds towards the nearest integer.This remainder method is an approximation and does not always equal the C#
%
, it is however very close.TODO:
Consider: