Description: I applied to some cells the COS and even SIN function (i do no try other trigonometric function) and i was surprised by the outputs ! Very annoying !!! So I'm wondering if there is something I'm missing that any of you would care to fill in for me ? I noticed that on two different distros ! Steps to Reproduce: 1.Choose a cell 2.type i;e; "=COS(180)" or "=COS(any cell filled by a number)" 3.Enter Actual Results: -0,5984600691 Expected Results: -1 Reproducible: Always User Profile Reset: No Additional Info: Is that happened only on my machine, or someone can confirm that's a bug ? Thanks. I've just tried SIN and it seems the same thing as COS ! Version: 5.1.6.2 Build ID: 1:5.1.6~rc2-0ubuntu1~xenial10 Threads CPU : 8; Version de l'OS :Linux 4.4; UI Render : par défaut; Locale : fr-FR (fr_FR.UTF-8); Calc: group
Created attachment 160049 [details] Screenshots of some cells illustrating the cos (and sin ) function
I followed Ramdan's steps and I can confirm that I had the same result in LibreOffice 6.1 and LibreOffice 7.0 PS: I'm not a developer. I submitted a few bugs and I thought I'd help by trying to confirm other bugs. ;-) ~~~ Version: 6.1.5.2 Build ID: 1:6.1.5-3+deb10u5 CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk2; Locale: en-US (en_US.UTF-8); Calc: group threaded Version: 7.0.0.0.alpha0+ Build ID: 4d03bd252274308f64332e7c0523068c38ac684a CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk3; TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2020-04-26_05:59:56 Locale: en-US (en_US.UTF-8); UI-Language: en-US Calc: threaded
Created attachment 160051 [details] LibreOffice 6.1 and the result of Cosinus(180)
Created attachment 160052 [details] LibreOffice 7.0 and the result of Cosinus(180)
Well, trignometric functions in Calc use radians instead of degrees for its angle parameters. So for the cosine of 180 degrees you need "COS(RADIANS(180))" which gives the correct result -1. This is well documented in both the tooltip information for Calc functions, and Help documentation. I believe MS Excel has the same behavior. I know there is a bug with more detailed information on this bugzilla, but I can't find it right now. Regardless, this is either NOTABUG or WONTFIX.
Created attachment 160053 [details] Cells with COS and SIN functions for some numbers (part1)
Ming Hua you're right, i missed this. In my mind it was degrees based. I'm reassured. Thanks a lot Bart and Ming Hua. Then now, as i'm not, like Bart, a developper what may i do to close this non-bug ? Anyway i can suggest that when you enter the cos function with fx, that we should be able to choose between degrees or radians to be more appropriate and permit non expert people to directly check degrees or radians, no ? Maybe is it too tedious ? Should i fill a "new bug" with enhancement option to suggest this ? Thanks both.
One thing is for sure ... we probably want to prevent that someone creates a spreadsheet with a cell containing a "=cos(1)", save it with LibreOffice Calc as a .xls, while LibreOffice Calc has been interpreting the 1 as a degree, but then MS Excel is interpreting the same 1 as a radius ... ;-) If that user is a civil engineer, we could get funny bridges. :-D
(In reply to Ramdan from comment #7) > Anyway i can suggest that when you enter the cos function with fx, that we > should be able to choose between degrees or radians to be more appropriate > and permit non expert people to directly check degrees or radians, no ? > Maybe is it too tedious ? Should i fill a "new bug" with enhancement option > to suggest this ? I'm not a developer either, just doing some QA work on bugzilla. From my experience, while your suggestion is reasonable, it would require a lot of work and without an interested developer, such discussions are usually fruitless. Still, you are free to make your argument, either here or as a new "request for enhancement" bug, but make sure to search the bugzilla to see if such request has been made before.