Div by zero#31
Conversation
|
Previously, if the
Results may vary depending on compiler settings and targets. |
|
Converted to draft so I can add docs to Knuth. |
Co-authored-by: Nicholas Rodrigues Lordello <n@lordello.net>
|
|
|
Hey, sorry I haven't had time to look at this yet. Will get around to reviewing it either this weekend or early next week. |
|
As it turns out, making the division function infallible can make a big difference iff the actual result of the division is unneeded. However, in that case, it sounds reasonable to put the responsibility on the programmer to remove the useless 256-bit division call. |
|
This is great. Will run the fuzzer on this to make sure nothing broke, then will merge. |
|
Is this lib still alive? |
|
It is (as in, I still use it), but https://github.com/recmo/uint is definitely in wider use and more actively maintained. I still need to run the fuzzer for this PR 🙈 - and haven't done so mostly because these performance optimizations aren't that useful for my usecase. |
Made some minor optimizations to udivmod4. Speed is not noticeably improved, but panic statements may be more helpful and binaries may be smaller.