...
Code Block | ||
---|---|---|
| ||
#include <float.h> long double ld; double d1; double d2; float f1; float f2; /* initializations */ if(d1 > FLT_MAX || d1 < -FLT_MAX) { /* Handle error condition */ } else { f1 = (float)d1; } if(ld > FLT_MAX || ld < -FLT_MAX) { /* Handle error condition */ } else { f2 = (float)ld; } if(ld > DBL_MAX || ld < -DBL_MAX) { /* Handle error condition */ } else { d2 = (double)ld; } |
Risk Analysis
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
FLP34-C | 1 (low) | 1 (unlikely) | 3 (low) | P3 | L3 |
References
Wiki Markup |
---|
\[[ISO/IEC 9899-1999:TC2|AA. C References#ISO/IEC 9899-1999TC2]\] Section 6.3.1.5, "Real floating types" |