-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Division bug in Programmer Calculator DEC mode #1583
Comments
This is your friendly Microsoft Issue Bot. I've seen this issue come in and have gone to tell a human about it. |
I can confirm the same issue with Calculator 10.2103.8.0. |
#1788 |
I noticed the remainder of pret after remrat(&pret, rat_one) is not in the same scale as px, in this case, so subrat(px, pret, precision); will produce a wrong result. void intrat(Inout PRAT* px, uint32_t radix, int32_t precision)
} |
I wrote a fix for this issue built on @rogitech's comment - PR #2300. Instead of flattening // Flatten pret in case it's not aligned with px after remrat operation
if (!equnum((*px)->pq, pret->pq))
{
flatrat(pret, radix, precision);
} |
Describe the bug
There's weird bug when you divide 4294967296 (0x100000000) by 255 (0xFF) in DEC mode. The output is 0
Also happens with:
4294967297 (0x100000001)
4294967298 (0x100000002)
4294967299 (0x100000003)
4294967300 (0x100000004)
4294967301 (0x100000005)
4294967302 (0x100000006)
4294967303 (0x100000007)
Steps To Reproduce
DEC way
DEC
4294967296
/
(Divide)255
=
(Result)HEX way
HEX
100000000
/
(Divide)FF
DEC
=
(Result)Expected behavior
Result should be 16843009 (0x1010101)
Screenshots
Screenshots may be not enough so I had recorded video
https://www.youtube.com/watch?v=J4If2A0BnQo
Device and Application Information
Requested Assignment
I'm just reporting this problem. I don't want to fix it.
The text was updated successfully, but these errors were encountered: