CERT.RTN.FLT.CAST.DBL

Functions returning a float value but effective returned value is of type double

Prevention

Explicitly cast the return type to float

Vulnerable code example

float calc_percentage(float value) { return value * 0.1f; }

Calculated return value could potentially be of non-float type and should be cast to float