Skip to content

Fix bugs in zz_addi, zz_subi functions#23

Open
ssinai1 wants to merge 1 commit intowbhart:masterfrom
ssinai1:fix-addi-subi-bug
Open

Fix bugs in zz_addi, zz_subi functions#23
ssinai1 wants to merge 1 commit intowbhart:masterfrom
ssinai1:fix-addi-subi-bug

Conversation

@ssinai1
Copy link

@ssinai1 ssinai1 commented Aug 29, 2022

These are corner case errors:
infinite recursion in zz_subi when c = LONG_MIN
and non-normalized result when a and c are both zero.
I fixed it by adding two new functions - not sure what the names should be (addu, addui...?).

…= LONG_MIN), and the non-normalization bug in zz_subi
turtle-dragonfly added a commit to turtle-dragonfly/bsdnt that referenced this pull request Mar 11, 2024
This bug is fixed in wbhart#23, but here
we add a test to demonstrate the issue, first.
@turtle-dragonfly
Copy link
Contributor

turtle-dragonfly commented Mar 11, 2024

Thank you for this fix. I would suggest adding some tests to exercise the issue(s).

I made one for myself, here: https://github.com/turtle-dragonfly/bsdnt/tree/test-inf-recursion-bug
Feel free to incorporate it (probably squash the commits).

@wbhart
Copy link
Owner

wbhart commented Mar 12, 2024

I agree. Thanks for the fix, but please consider adding some tests for the new functions. The general philosophy should be one of testing every function.

There should be tests for the original issue as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants