Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bgColor#FFCCCC
short a;
int b;
long c;

float d;
double e;
double f;

a = 533;
int b = 6789;
long c = 466438237;

float d = a / 7; /* d is 76.0 */
double e = b / 30; /* e is 226.0 */
double f = c / 789; /*  f is 591176.0 */

...

Code Block
bgColor#CCCCFF
short a  = 533;
int b = 6789;
long c = 466438237;

float d = a / 7.0f; /* d is 76.14286 */
double e = b / 30.0f; /* e is 226.3 */
double f = c / 789.0f; /* f is 591176.47275 */

...

Code Block
bgColor#CCCCFF
short a = 533;
int b = 6789;
long c = 466438237;

float d = a;;
double e;
double f;

a=533;
b=6789;
c=466438237;

d=a;
e=b;
f=c;
d/=7;
e/=30;
f/=789;

printf("Value of d is %f\n", d);  // Correct value of d i.e.     76.142860 is printed
printf("Value of e is %f\n", e);  // Correct value of e i.e.    226.300000 is printed
printf("Value of f is %f\n", f);  // Correct value of f i.e. 591176.472750 is printed= b;;
double f = c;;

d /= 7; /* d is 76.14286 */
e /= 30; /* e is 226.3 */
f /= 789; /* f is 591176.47275 */

Risk Assessment Summary

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

FLP33-C

1 (low)

2 (probable)

1 (high)

P2

L3

...