Panic on division by zero - #57
aritkulova wants to merge 5 commits into
Conversation
removed safe_div_128 and safe_div_256 because they duplicate `div` functionality
|
For now, 2 test are failing due to BlockstreamResearch/smplx#151 |
|
Running tests with the -v flag helped (all tests were successful), but it feels like a temporary solution. |
|
In 99f2449: This is a 14000-line diff which does multiple things, none of which seem related to this PR. |
|
Hi, I was going to file a bug report about inconsistent division by zero behavior before I learned that you were working on this. It looks like you have fixed the inconsistent behavior! Two questions from my end: (1) Did you mean to remove the 128-bit and 256-bit versions of the functions? (That's fine with me if it was intentional.) (2) Could you double check the docs updates? It looks like you've accidentally deleted the documentation for |
|
In a1ccb94: "Underflow" is not the correct word for when subtraction overflows. "Underflow" is about floating-point values rounding to zero. (I know this was present in the original code, but highlighting it now.) The code changes in this commit look fine to me, other than the deleted functions, formatting changes, deleted tests, etc. |
|
I think this PR would be much clearer if it first changed tests to avoid division by 0, then refactored the "big" division methods to never pass 0 to the basic ones, and then updated the basic ones, and then added tests for the corrected division by 0 behavior. |
|
@schoen, hi
Although, now that I think about it, it may be better to rename all
|
added -v workaround to ci; fixed typos
aa40069 to
2db0182
Compare
|
I think it's a good idea to have a consistent API for all |
|
@Hrom131 Cool! I think I'll make a separate PR to remove the |
Refactors division (including mul_div) functions in the std library to panic on division by zero by default.