Add fltflt rounding and fmod functions#1129
Merged
tbensonatl merged 6 commits intomainfrom Mar 2, 2026
Merged
Conversation
Also add fltflt_add_same_sign(), with is more efficient than fltflt_add() for the case where we know both inputs have the same sign. Signed-off-by: Thomas Benson <tbenson@nvidia.com>
Signed-off-by: Thomas Benson <tbenson@nvidia.com>
Signed-off-by: Thomas Benson <tbenson@nvidia.com>
Signed-off-by: Thomas Benson <tbenson@nvidia.com>
Contributor
Greptile SummaryThis PR adds four new float-float arithmetic functions: round-to-nearest (with ties to even), truncate toward zero, floor (truncate toward negative infinity), and fmod (floating-point remainder). The implementation includes proper edge case handling with zero-division guards returning NaN, consistent use of Key changes:
Previous feedback addressed: Confidence Score: 5/5
Important Files Changed
Last reviewed commit: 7a37881 |
cliffburdick
approved these changes
Feb 27, 2026
Collaborator
|
/build |
1 similar comment
Collaborator
Author
|
/build |
- Add fltflt_fmod unit tests
- Updated fltflt_fmod to return {NaN, NaN} in the case of a zero divisor
Signed-off-by: Thomas Benson <tbenson@nvidia.com>
Collaborator
Author
|
/build |
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.
Add support for the following float-float (fltflt) functions:
Also includes are new unit tests and benchmarks for the newly introduced functions.