You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry, not sure if this related to the update just pushed, or some other issue, but now there seems to be some problem with the integers? Both with as_tuple and even with normal arithmetic... could be my misunderstanding of the correct behavior though. This is with the most recent version just pushed.
The powers of p have the same tuple representation
The idea for .as_tuple is to represent the mantissa only, see Eq. 3.13 of arXiv:2203.04269. More specifically, the entries of the tuple are the $a_i$'s of Eq. 3.13. These are a series of numbers between $0$ and $p-1$, included. Similarly to the usual real/complex floating-point numbers, different numbers may have the same mantissa (a.k.a. significand) but differ in the exponent part. For PAdic the exponent is stored in .n.
As for the weird behavior with equality, this only happens when a number becomes proportional to the prime, and thus the number of significant digits changes. I wouldn't say this is a bug. For instance,
doesn't return True is that the number of significant digits differs on the two sides, as you show in your message one is O(2^5), and the other is O(2^6). PAdic(2,2,4) was instantiated with 4 significant digits, but after the sum only 3 significant digits are left. The equality has no way to know if the $4^{th}$ digit is the same, so it returns False. Using .as_tuple we see clearly the difference:
because the left-hand side gives the approximate result 0.0, while the right-hand side correctly returns 1e-17 . In general, I would say that it is safer to check if two numbers are close, rather than equal.
Sorry, not sure if this related to the update just pushed, or some other issue, but now there seems to be some problem with the integers? Both with as_tuple and even with normal arithmetic... could be my misunderstanding of the correct behavior though. This is with the most recent version just pushed.
The powers of p have the same tuple representation
Normal arithmetic seems broken
The text was updated successfully, but these errors were encountered: