I cannot find any check for "Floating point expressions shall not be compared using either the == or != operators." - is there one?
My company's standards justify this rule with:
"Comparing floating point expressions for equality or inequality is a famous source of well-documented software system failures."
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It seems we don't have it. But I thought every compiler would have such warning. I.e. gcc has -Wfloat-equal. Do you feel it's acceptable to use gcc for this (and possibly get various other warnings)?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I cannot find any check for "Floating point expressions shall not be compared using either the == or != operators." - is there one?
My company's standards justify this rule with:
"Comparing floating point expressions for equality or inequality is a famous source of well-documented software system failures."
It seems we don't have it. But I thought every compiler would have such warning. I.e. gcc has
-Wfloat-equal
. Do you feel it's acceptable to use gcc for this (and possibly get various other warnings)?