bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: scanf of floats and then prints is not same


From: Mike Castle
Subject: Re: scanf of floats and then prints is not same
Date: Mon, 14 May 2001 17:55:52 -0700
User-agent: Mutt/1.3.6i

On Mon, May 14, 2001 at 03:58:57PM -0700, Mudit Wahal wrote:
> file has 45.92. Is it a bug in scanf ? Or am I missing something ?

You're missing something.

Floating point numbers are not exact.  You can NOT do comparisons like
this.  Period.

Do a web search for "comp.lang.c faq"

mrc
-- 
       Mike Castle       Life is like a clock:  You can work constantly
  address@hidden  and be right all the time, or not work at all
www.netcom.com/~dalgoda/ and be right at least twice a day.  -- mrc
    We are all of us living in the shadow of Manhattan.  -- Watchmen



reply via email to

[Prev in Thread] Current Thread [Next in Thread]