Skip to content
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

Error converting HEX to DECIMAL #34

Closed
bifacil opened this issue Feb 24, 2022 · 2 comments
Closed

Error converting HEX to DECIMAL #34

bifacil opened this issue Feb 24, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@bifacil
Copy link

bifacil commented Feb 24, 2022

KALK 0.4.0 is not converting well hex numbers to decimal.

For instance 0x0123 should be 291:

image

It only happens when the HEX number is expressed with odds digits...

@xoofx xoofx added question Further information is requested bug Something isn't working and removed question Further information is requested labels Feb 24, 2022
@xoofx
Copy link
Owner

xoofx commented Feb 24, 2022

Indeed, thanks for reporting this. The rule for unpaired hex number is assuming - wrongly - that something like this 123 it read as 12 03, hence why you see these results.

>>> hex "123"
# hex("123")
out = 4611
>>> hex "1203"
# hex("1203")
out = 4611

@xoofx
Copy link
Owner

xoofx commented Mar 6, 2022

Should be fixed by commit d35a5f9 and available in upcoming version 0.5.0+

@xoofx xoofx closed this as completed Mar 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants