Answer from Function is incorrect : <p>The answer of this function is returned into the main function of the program, and that works fine. The issue is that any value where the cosine should be 0, it turns out to give a weird irrational number (something like 1.30431912*10^-13). So, 90, 450, and so on, all turn out irrational answers. What's the matter?</p>

<pre><code>  float cosineDegrees() {
        string i;
        double iDouble;

        cout &lt;&lt; "Give me a number to find the value of degrees in. ";
        getline(cin, i);

        iDouble = stod(i);

        double PI = 3.14159265359;

        float answer = cos((PI/180)*iDouble);

        return answer;


    }
</code></pre>
