Opened 8 years ago

Last modified 7 years ago

#4936 new defect

Sine and Cosine producing wrong outputs

Reported by: Abrahm Owned by:
Priority: Normal Milestone: Unspecified
Component: Calculate Version: Unspecified
Severity: Minor Keywords:
Cc: Distribution/OS:
Bug Status: New

Description

For values ranging from 181 to 185 (in degrees) Sine gives positive values instead of negative values same thing happens for cosine in range of 91 to 95 degrees . This error is also persistent in radian mode!

Change History (5)

comment:1 Changed 8 years ago by quozl

  • Bug Status changed from Unconfirmed to New
  • Distribution/OS Ubuntu deleted
  • Priority changed from Unspecified by Maintainer to Normal
  • Severity changed from Trivial to Minor

Confirmed. Root cause is sign of result not displayed when result is long. Proof:

sin(179) = 0.0174524...                    <-- correct
sin(181) = 0.0174524...                    <-- should be negative
sin(181)+sin(179) = nearly zero            <-- correct
sin(181)-negate(sin(179)) = nearly zero    <-- correct

Perhaps solved by pending pull requests:

Last edited 8 years ago by quozl (previous) (diff)

comment:2 Changed 7 years ago by nguyenla

We have investigated and completely solved this issue. Please accept our pull request:
https://github.com/sugarlabs/sugarlabs-calculate/pull/37
Thank you.

comment:3 Changed 7 years ago by shiwakoa

Hi,

We found out that the bug still exists in the most recent version of Calculate Activity. Please assign us this bug and we will look at the source code and try to figure out the issue.

Thank you.

comment:4 Changed 7 years ago by quozl

Thanks. Please see https://github.com/sugarlabs/sugarlabs-calculate/pull/37 for the further work required before this pull request is merged.

Other pull requests were not a solution:

Note: See TracTickets for help on using tickets.