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

Loss of precision on int64s in numpy >= 1.22 #40

Closed
TedSinger opened this issue Jul 30, 2024 · 3 comments · Fixed by #41
Closed

Loss of precision on int64s in numpy >= 1.22 #40

TedSinger opened this issue Jul 30, 2024 · 3 comments · Fixed by #41

Comments

@TedSinger
Copy link

TedSinger commented Jul 30, 2024

import fixfmt
import numpy
fmt = fixfmt._ext.Number(19, -1, pad=' ', sign=' ' , nan='NaN', inf='inf', point='.', bad='#')
x = 1600000000000000127
print(fmt(x))
# 1600000000000000127
print(fmt(numpy.int64(x)))
# 1600000000000000000

numpy 1.22.0 and up all reveal this issue, but 1.21.6 does not.

@TedSinger TedSinger changed the title Loss of precision on Longs in numpy >= 1.22 Loss of precision on int64s in numpy >= 1.22 Jul 30, 2024
@alexhsamuel
Copy link
Owner

Reproduced; thanks for reporting. I'll take a look.
Happy to see someone using this repo.

alexhsamuel added a commit that referenced this issue Aug 7, 2024
alexhsamuel added a commit that referenced this issue Aug 7, 2024
@alexhsamuel
Copy link
Owner

Fixed in 0.13.3.

@TedSinger
Copy link
Author

Thank you!

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 a pull request may close this issue.

2 participants