I have a program designed to test for the various instances of Side-Angle-Side triangles, but I'm getting a warning that I think might be screwing up my program.
Essentially, I have the two if-statements
if (sideA == sideB * sin(angA))
and
else if (sideB > sideA && sideA > sideB * sin(angA))
Where sideA, sideB, and angA are all doubles and angA is entered as degrees and converted to radians via the equation angA = angA * 3.14159 / 180.
The issue I'm having is that my program is reading the latter statement when it should be reading the former. Specifically, when I enter sideA as 5, sideB as 10, and angA as 30, the expression sideB * sin(angA) is read as 5. For some reason though, instead of following through with this as "5 == 5 and therefore the first if statement should be ran," the contents of the "else if" statement is being ran.
The less likely reason for this issue in my mind is that I'm being too conservative with the number of digits of PI I'm using and I should increase it; the more likely reason is the warning I'm getting that states
warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
else if (sideA == sideB * sin(angA)) {
^
Which is something I have no clue how to deal with and cannot find out how to online.