On Fri, Aug 7, 2009 at 11:57 AM, Uday Oberio <[email protected]> wrote:

> float a=1.1;
> double b=1.1;
> if(a==b)
> printf("hello");
> else
> printf("how are u ");
>
> now tell me which part will be executed

Either one may be executed.

> and why ?

Because you cannot compare floats for exactness like you're trying to do.

Have a read of <http://docs.sun.com/source/806-3568/ncg_goldberg.html>

--
PJH

http://shabbleland.myminicity.com/com
http://www.chavgangs.com/register.php?referer=9375

Reply via email to