Re: [sage-devel] sqrt(n) conversion/comparison

2015-02-28 Thread Ralf Stephan
On Friday, February 27, 2015 at 7:58:24 PM UTC+1, Nils Bruin wrote: > > On Friday, February 27, 2015 at 8:36:52 AM UTC-8, Ralf Stephan wrote: > >> Which of these do not use Maxima? >> > > You can figure that out by making sure that maxima doesn't work anymore: > Thanks. It appears to have nothin

Re: [sage-devel] sqrt(n) conversion/comparison

2015-02-27 Thread Nils Bruin
On Friday, February 27, 2015 at 8:36:52 AM UTC-8, Ralf Stephan wrote: > Which of these do not use Maxima? > You can figure that out by making sure that maxima doesn't work anymore: sage: integrate(x,x) #trigger maxima initialization 1/2*x^2 sage: sage.libs.ecl.shutdown_ecl() #any existing ecl o

Re: [sage-devel] sqrt(n) conversion/comparison

2015-02-27 Thread Ralf Stephan
On Thursday, February 26, 2015 at 10:10:03 AM UTC+1, vdelecroix wrote: > > We also have > > sage: RR(tan(pi/20)) == CC(tan(pi/20)) > False > The utility code in #17866 uncovers more: sage: bool(csc(2)==CC(csc(2))) False sage: bool(csch(2)==CC(csch(2))) False sage: bool(arcsec(2)==CC(arcsec(2)))

Re: [sage-devel] sqrt(n) conversion/comparison

2015-02-26 Thread Ralf Stephan
Assuming fp values cannot be equal, would it make more sense to test elementship in CC by implementing ComplexField.__contains__() instead of trusting Python or Maxima == ? -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this g

Re: [sage-devel] sqrt(n) conversion/comparison

2015-02-26 Thread Vincent Delecroix
We also have sage: RR(tan(pi/20)) == CC(tan(pi/20)) False But it seems right for cos, sin, exp, atan, cosh, sinh. Is there a way to test all symbolic functions? 2015-02-26 10:02 UTC+01:00, Ralf Stephan : > On Thursday, February 26, 2015 at 9:50:40 AM UTC+1, vdelecroix wrote: >> >> sage: bool(RR(

Re: [sage-devel] sqrt(n) conversion/comparison

2015-02-26 Thread Ralf Stephan
On Thursday, February 26, 2015 at 9:50:40 AM UTC+1, vdelecroix wrote: > > sage: bool(RR(sqrt(2)) == sqrt(2)) > False > sage: sqrt(2).n() == RR(sqrt(2)) > True > These two come from bool(sqrt(2)==sqrt(2).n()) being False I think (because Maxima is involved here) but this is different than sage

Re: [sage-devel] sqrt(n) conversion/comparison

2015-02-26 Thread Vincent Delecroix
Hello, There is something wrong sage: bool(RR(pi) == pi) True sage: bool(RR(golden_ratio) == golden_ratio) True which is fine to me. You coerce to the field with less precision. But sage: bool(RR(sqrt(2)) == sqrt(2)) False sage: sqrt(2).n() == RR(sqrt(2)) True sage: RR(sqrt(2)) == CC(sqrt(2)) F

[sage-devel] sqrt(n) conversion/comparison

2015-02-26 Thread Ralf Stephan
Hi, with current Sage, sage: bool(sqrt(2)==CC(sqrt(2))) False You would expect that this leads to sage: sqrt(2) in CC False but due to a bug I'm fixing atm in #12967 this returns True. However, now that it's fixed I'm faced with the question if answer to both really should be False. If one doctes