AnsweredAssumed Answered

C Language Syntax Question- Casting on Constants

Question asked by PG1 on Jun 14, 2012
Latest reply on Jun 14, 2012 by Erich Styger

I'm using Codewarrior for S08 if it matters.

 

Why would (or Why Should)

 

float foo;

(if foo==14.7)

{.....}

 

produce different results from

 

float foo;

if (foo==(float)14.7)

{...}

 

 

if the value stored in foo was identical (as viewed with hexadecimal formatting in the Debugger)

Outcomes