Re: [sage-support] bug in == operator?
Hi They do look equal: sage: m.n() 3.82247666339266e53 sage: m1.n() 3.82247666339266e53 Regards, Jan On 13 July 2015 at 08:54, David Goldberg dg.paloa...@gmail.com wrote: This is in SageMath Version 6.6, Release Date: 2015-04-14 running on a MacBook. The following lines print 'equal', even though m and m1 do not appear equal to me! m=540579833922455191419978421211010409605356811833049025*sqrt(1/2) m1=382247666339265723780973363167714496025733124557617743 if m == m1: print equal -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout. -- .~. /V\ Jan Groenewald /( )\www.aims.ac.za ^^-^^ -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
Re: [sage-support] bug in == operator?
For fun I found the continued fraction expression of the ratio of these two big integers: 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 1, 3, 12, 5, 1, 2, 1, 19, 3, 3, 3, 1, 1, 3, 2, 2, 3, 1, 5, 1, 4, 28, 2, 1, 3, 1, 2, 2, 1, 1, 1, 1, 10, 4, 1, 5, 6, 13, 1, 1, 2, 23, 1, 3, 16, 1, 29, 14, 4, 1, 3, 2. It agrees with sqrt(2) for 70 steps. On 2015-7-12 23:54, David Goldberg wrote: This is in SageMath Version 6.6, Release Date: 2015-04-14 running on a MacBook. The following lines print 'equal', even though m and m1 do not appear equal to me! m=540579833922455191419978421211010409605356811833049025*sqrt(1/2) m1=382247666339265723780973363167714496025733124557617743 if m == m1: print equal -- *\\* Anton Sherwood *\\* www.bendwavy.org -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
Re: [sage-support] bug in == operator?
On Sun, Jul 12, 2015 at 11:54 PM, David Goldberg dg.paloa...@gmail.com wrote: This is in SageMath Version 6.6, Release Date: 2015-04-14 running on a MacBook. The following lines print 'equal', even though m and m1 do not appear equal to me! m=540579833922455191419978421211010409605356811833049025*sqrt(1/2) m1=382247666339265723780973363167714496025733124557617743 if m == m1: print equal Hi, Despite what other people are saying in this thread, I definitely 100% consider the above a bug. Doing m == m1, should first coerce both to SR, then compare there. Comparison there is supposed to currently return true only if we can prove the two things are equal -- otherwise false (that said, there is a proposal to raise an exception if equality can't be determined, which I like). I think at one point in time Robert Bradshaw implemented comparison in SR using interval arithmetic and progressively higher precision; then if that suggested equality (it can't ever prove it), then Sage would fall back to other methods. Anyways, definitely a very serious bug. William https://cloud.sagemath.com/projects/4a5f0542-5873-4eed-a85c-a18c706e8bcd/files/support/2015-07-13-084935-precision.sagews -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout. -- William (http://wstein.org) -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
Re: [sage-support] bug in == operator?
On Monday, July 13, 2015, Nathann Cohen nathann.co...@gmail.com wrote: Despite what other people are saying in this thread, I definitely 100% consider the above a bug. Despite what you say about what other said, I also believe that it is a bug and that others in this thread agree with you. But what about *two* bugs? 1) SR says that two unequal things are equal, and it should not say so unless it can *prove* it (and here it cannot) +1 2) Why should an_integer * sqrt(1/2) belong to SR? Why isn't it turned into an algebraic number immediately? If it did, the problem, Nils answered 2 already and I agree with Nils. would be solved too, for: sage: QQbar(m) == m1 False Nathann -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com javascript:;. To post to this group, send email to sage-support@googlegroups.com javascript:;. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout. -- Sent from my massive iPhone 6 plus. -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
Re: [sage-support] bug in == operator?
Despite what other people are saying in this thread, I definitely 100% consider the above a bug. Despite what you say about what other said, I also believe that it is a bug and that others in this thread agree with you. But what about *two* bugs? 1) SR says that two unequal things are equal, and it should not say so unless it can *prove* it (and here it cannot) 2) Why should an_integer * sqrt(1/2) belong to SR? Why isn't it turned into an algebraic number immediately? If it did, the problem, would be solved too, for: sage: QQbar(m) == m1 False Nathann -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
Re: [sage-support] bug in == operator?
2) Why should an_integer * sqrt(1/2) belong to SR? Why isn't it turned into an algebraic number immediately? If it did, the problem, Nils answered 2 already and I agree with Nils. I do not think that he did. The __repr__ function of algebraic numbers is bad indeed, but if we can have this: sage: QQbar(sqrt(2)) sqrt(2) Then I believe that an_integer*sqrt(2) should be a member of QQbar, and not rely on SymbolicRing. I just created a thread about this __repr__ issue: https://groups.google.com/forum/#!topic/sage-devel/dB-E7VjEFr4 Nathann -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.