Lack of precision for sin/cos

Issue #8 closed
Johan Thelin created an issue

Originally reported on Google Code with ID 8

What steps will reproduce the problem?
1. sin( pi ) = 0 (0.05480366514878953089 is returned)
2. cos( pi ) = 1 (0.99849714986386383364 is returned)

What is the expected output? What do you see instead?

  0 and 1

Reported by e8johan on 2006-09-08 13:07:02

Comments (8)

  1. Former user Account Deleted

    ``` This bug is present also in KCalc. ```

    Reported by `lopezibanez` on 2006-09-11 00:14:49

  2. Former user Account Deleted

    ```

    GNU libc returns sin(M_PI) = 1.22461e-16 and sinl(M_PIl) = -5.42101e-20 Still, a calculator that is not limited by speed should do it better. My pocket calculator returns sin(pi) = 0 and sin(pi - 10^-5) = 0.00001 ```

    Reported by `lopezibanez` on 2006-09-11 00:37:09

  3. Former user Account Deleted

    ``` And by the way, cos(pi) = -1 ```

    Reported by `lopezibanez` on 2006-09-11 00:38:41

  4. Former user Account Deleted

    ``` Ups! Stupid as I am sometimes, I was using degrees instead of radians.SpeedCrunch gives the correct answer when using radians. Please close this and let's forget about it. ```

    Reported by `lopezibanez` on 2006-09-12 14:18:09

  5. Former user Account Deleted

    ``` Closing it. ```

    Reported by `ariya.hidayat` on 2006-10-08 04:32:28 - Status changed: `Verified`

  6. Log in to comment