Thank you Thierry, I had stupidly only looked at the doctests for cos in Sage 7.2. Bruno
On 09/16/2017 06:16 PM, Thierry wrote: > Hi, > > this might be related to: > > https://trac.sagemath.org/ticket/20752 > https://trac.sagemath.org/ticket/20742 > > (and it is doctested). > > Ciao, > Thierry > > > > On Sat, Sep 16, 2017 at 03:17:27PM -0400, Bruno Le Floch wrote: >> Hello, >> >> In fact, it seems that in Sage 7.2, cos((p/q)*pi) gets reduced mod pi >> instead of 2pi, at least in cases where it does not simplify to square >> roots: >> >> sage: [cos(pi*(i+13)/13) - cos(pi*i/13) >> for i in range(0,50) if i%13!=0] == [0]*46 >> True >> >> It would be good to know what fixed that bug. It might be a Ginac bug. >> Perhaps cos(14*pi/9) should be added as a test of the cos function? >> >> Bruno >> >> On 09/16/2017 07:43 AM, John Cremona wrote: >>> You should upgrade to a more recent version: >>> >>> ┌────────────────────────────────────────────────────────────────────┐ >>> │ SageMath version 8.0, Release Date: 2017-07-21 │ >>> │ Type "notebook()" for the browser-based notebook interface. │ >>> │ Type "help()" for help. │ >>> └────────────────────────────────────────────────────────────────────┘ >>> sage: float(cos(14*pi/9)) >>> 0.17364817766693041 >>> >>> >>> >>> On 16 September 2017 at 12:27, Mickael Pechaud <mickaelpech...@gmail.com> >>> wrote: >>>> Hello, >>>> >>>> I'm running SageMath 7.2, on a 64bits laptop with a Ubuntu 16.04.2 LTS >>>> (xenial). I got a wrong answer from cos : >>>> >>>> sage: float(cos(14*pi/9)) >>>> -0.17364817766693041 >>>> >>>> It should be positive - and it's inconsistent with the following lines : >>>> >>>> sage: float(cos(14*pi/9-2*pi)) >>>> 0.17364817766693041 >>>> >>>> >>>> sage: float(14*pi/9) >>>> 4.886921905584122 >>>> >>>> sage: float(cos(4.886921905584122)) >>>> 0.17364817766692953 >>>> >>>> Am I missing something, or is there an actual problem here ? >>>> >>>> Thanks in advance, >>>> >>>> Mickaël >>>> >>>> -- >>>> You received this message because you are subscribed to the Google Groups >>>> "sage-devel" group. >>>> To unsubscribe from this group and stop receiving emails from it, send an >>>> email to sage-devel+unsubscr...@googlegroups.com. >>>> To post to this group, send email to sage-devel@googlegroups.com. >>>> Visit this group at https://groups.google.com/group/sage-devel. >>>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "sage-devel" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to sage-devel+unsubscr...@googlegroups.com. >> To post to this group, send email to sage-devel@googlegroups.com. >> Visit this group at https://groups.google.com/group/sage-devel. >> For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.