Sine P37619


Statement
 

pdf   zip

thehtml

Write a program that reads angles in degrees and writes their sine. In order to solve this problem, you are requested to use the following Taylor series:

  sinx = x −
x3
3!
 + 
x5
5!
 − 
x7
7!
 + ⋯.

Input

Input consists of angles in degrees in the [−180,180] interval.

Output

For each given angle, print its sine in a line.

Observation

The checker of this problem tolerates absolute errors up to ‍0.001.

Public test cases
  • Input

    0
    -180
    180
    45
    60
    -60
    12.123
    12.123001
    

    Output

    0
    -2.3521e-16
    2.3521e-16
    0.707107
    0.866025
    -0.866025
    0.210011
    0.210011
    
  • Information
    Author
    Jordi Petit
    Language
    English
    Translator
    Jordi Petit
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    C++
    User solutions
    C++