ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 01 Jun 2016 16:58:47 +0200Bug in cos function in version 7.2https://ask.sagemath.org/question/33623/bug-in-cos-function-in-version-72/I have 'SageMath version 7.2, Release Date: 2016-05-15' and when I enter `cos(pi*(1+(5/63)))` it returns `cos(5/63*pi)` which is incorrect (there should be a negative sign in front). Entering `cos(N(pi)*(1+(5/63)))` returns `-0.969077286229078` which is correct, but entering `N(cos(pi\*(1+(5/63))))` returns `0.969077286229078`. Similar things happen when `5/63` is replaced with other fractions, but not always. Usually if the fraction is "nice", like `1/4` or `1/5` then it seems to get the right answer. I assume this has something to do with the exact answer being able to be expressed nicely with square roots, but I don't really know. Same happens with `sin` as far as I can tell. Anybody else having this problem?
Wed, 01 Jun 2016 16:31:58 +0200https://ask.sagemath.org/question/33623/bug-in-cos-function-in-version-72/Answer by tmonteil for <p>I have 'SageMath version 7.2, Release Date: 2016-05-15' and when I enter <code>cos(pi*(1+(5/63)))</code> it returns <code>cos(5/63*pi)</code> which is incorrect (there should be a negative sign in front). Entering <code>cos(N(pi)*(1+(5/63)))</code> returns <code>-0.969077286229078</code> which is correct, but entering <code>N(cos(pi\*(1+(5/63))))</code> returns <code>0.969077286229078</code>. Similar things happen when <code>5/63</code> is replaced with other fractions, but not always. Usually if the fraction is "nice", like <code>1/4</code> or <code>1/5</code> then it seems to get the right answer. I assume this has something to do with the exact answer being able to be expressed nicely with square roots, but I don't really know. Same happens with <code>sin</code> as far as I can tell. Anybody else having this problem?</p>
https://ask.sagemath.org/question/33623/bug-in-cos-function-in-version-72/?answer=33624#post-id-33624This is clearly a bug, thanks for reporting ! This is now [trac ticket 20752](https://trac.sagemath.org/ticket/20752)
Wed, 01 Jun 2016 16:58:47 +0200https://ask.sagemath.org/question/33623/bug-in-cos-function-in-version-72/?answer=33624#post-id-33624