Re: float values can b rounded off?

From: CBFalconer (cbfalconer_at_yahoo.com)
Date: 01/21/05


Date: Fri, 21 Jan 2005 16:30:57 GMT

sushant wrote:
>
> the code:
>
> int main(void)
> {
> float i=6.10203;
> printf("%d",i);
> return 0;
> }
> is giving the o/p zero. why??????

Screw ups:
1. Posting via google and losing all indentation. See sig.
2. Failure to #include <stdio.h>
3. Lying to the compiler about the type of i in the printf.
4. lack of blanks within the code (foolish style).

Either of 2 or 3 result in undefined behavior.

-- 
"If you want to post a followup via groups.google.com, don't use
 the broken "Reply" link at the bottom of the article.  Click on 
 "show options" at the top of the article, then click on the 
 "Reply" at the bottom of the article headers." - Keith Thompson


Relevant Pages

  • Re: Good time
    ... mostly puts me at the bottom. ... I don't use Google but I can see what you are talking about. ... of the text to which I am not responding. ... it becomes a mess whether top posting or bottom posting. ...
    (rec.music.makers.guitar.jazz)
  • Re: Jam Police Radar with Cold Plasma
    ... "While the concept may be foreign or, possibly, even repugnant to ... even Google advises bottom posting:" ... Google believes as "appropriate." ... you didn't even need to scroll down to the bottom of the listing ...
    (sci.electronics.basics)
  • Re: top or bottom
    ... I wouldn't mind bottom posting if people would snip all the extraneous ... if people would snip the headers and just leave the poster's signature ... days old might not even be shown, meaning you would need to use Google or ...
    (rec.crafts.textiles.quilting)
  • Re: calling an id before he was created
    ... Click on "show options" at the top of the article, then click on the "Reply" at the bottom of the article headers. ... yes, i've recived replies from another webSite, DevSomething... ... are not posting to Google, you are posting to Usenet using a Google interface. ...
    (comp.lang.javascript)
  • Re: Weak references - I must be missing something...
    ... > Mike Schilling wrote: ... >> object is no longer referenced without losing the information in that ... A good way to tell if a posting made it into the world is to check Google ...
    (comp.lang.java.programmer)

Loading