-
Notifications
You must be signed in to change notification settings - Fork 12
Mike/improve/math #65
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
Conversation
- Add basic upward rounding division test for ray_div_up function - Test with small numbers (100, 3) and larger numbers (1000 RAY, 300 RAY) - Verify upward rounding behavior with expected values - Update imports to include ray_div_up function
- Add edge cases test for ray_div_up function - Test zero numerator handling (should return 0) - Test exact division scenarios (600 RAY / 200 RAY) - Test very small remainder cases (1000 RAY + 1 / 1000 RAY) - Verify upward rounding behavior in edge cases
- Add division by zero test for ray_div_up function - Test that ray_div_up(1000, 0) properly aborts with EDIVISION_BY_ZERO error - Verify error handling behavior for invalid input parameters - Use expected_failure annotation to test error conditions
- Add overflow test for ray_div_up function - Test that ray_div_up properly aborts with EOVERFLOW error when input is too large - Verify overflow handling behavior for extreme input parameters - Use expected_failure annotation to test overflow conditions
- Add basic downward rounding division test for ray_div_down function - Test with small numbers (100, 3) and larger numbers (1000 RAY, 300 RAY) - Verify downward rounding behavior with expected values - Update imports to include ray_div_down function
- Add edge cases test for ray_div_down function - Test zero numerator handling (should return 0) - Test exact division scenarios (600 RAY / 200 RAY) - Test very small remainder cases (1000 RAY + 1 / 1000 RAY) - Verify downward rounding behavior in edge cases
- Add division by zero test for ray_div_down function - Test that ray_div_down(1000, 0) properly aborts with EDIVISION_BY_ZERO error - Verify error handling behavior for invalid input parameters - Use expected_failure annotation to test error conditions
- Add directional comparison test for ray_div functions - Test that ray_div_up >= ray_div >= ray_div_down for same inputs - Verify proper ordering of rounding results (700 RAY / 300 RAY) - Ensure directional rounding maintains mathematical consistency
- Add basic upward rounding multiplication test for ray_mul_up function - Test with small numbers (100, 3) and larger numbers (500 RAY, 200 RAY) - Verify upward rounding behavior with expected values - Update imports to include ray_mul_up function
- Add edge cases test for ray_mul_up function - Test zero operand handling (should return 0) - Test exact multiplication scenarios (500 RAY * 200 RAY) - Verify upward rounding behavior in edge cases
- Add overflow test for ray_mul_up function - Test that ray_mul_up properly aborts with EOVERFLOW error when input is too large - Verify overflow handling behavior for extreme input parameters - Use expected_failure annotation to test overflow conditions
- Add basic downward rounding multiplication test for ray_mul_down function - Test with small numbers (100, 3) and larger numbers (500 RAY, 200 RAY) - Verify downward rounding behavior with expected values - Update imports to include ray_mul_down function
- Add edge cases test for ray_mul_down function - Test zero operand handling (should return 0) - Test exact multiplication scenarios (500 RAY * 200 RAY) - Verify downward rounding behavior in edge cases
- Add directional comparison test for ray_mul functions - Test that ray_mul_up >= ray_mul >= ray_mul_down for same inputs - Verify proper ordering of rounding results (700 RAY * 300 RAY) - Ensure directional rounding maintains mathematical consistency
- Add exact division consistency test for ray_div functions - Test that ray_div_up and ray_div_down give same result for exact division - Verify mathematical consistency when no rounding is needed (600 RAY / 200 RAY) - Ensure directional rounding functions behave correctly for exact cases
- Add comprehensive directional rounding consistency test - Test both division and multiplication with remainder scenarios - Verify ray_div_up > ray_div_down for non-exact division (700 RAY / 300 RAY) - Verify ray_mul_up == ray_mul_down for exact multiplication (700 RAY * 300 RAY) - Ensure directional rounding functions maintain expected mathematical behavior
- Add protocol safety test for directional rounding functions - Test small debt calculation scenario (should not round to zero) - Test collateral calculation scenario (should not overestimate) - Test interest calculation precision with exact rate multiplication - Verify directional rounding provides protocol safety benefits in real-world scenarios
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #65 +/- ##
==========================================
+ Coverage 97.69% 97.70% +0.01%
==========================================
Files 38 38
Lines 781 785 +4
==========================================
+ Hits 763 767 +4
Misses 18 18
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
mpsc0x
left a comment
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.
LGTM
add
ray_div_up
ray_div_down
ray_div_up
ray_div_down
into way_ray_math.move
add 17 test cases.