User Profile

Collapse

Profile Sidebar

Collapse
hendrixx
hendrixx
Last Activity: Jun 6 '07, 06:13 AM
Joined: Jun 3 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • hendrixx
    replied to comparing floating point numbers
    in C
    well i found the ans wer nd its not wht u all r saying .....floats or doubles can be compared using >= etc the ans lies in the internal representation of floats and doubles
    float is represented using IEEE 754 single precision
    double by IEEE 754 double precision so .7>.7f and so on.....thnx newayz
    See more | Go to post

    Leave a comment:


  • well ++ hs higher precedence thn + and therefore ur expression becomes
    (++a) + (++a)
    and the result is 23 ;

    (11)+(12)
    See more | Go to post

    Leave a comment:


  • hendrixx
    started a topic comparing floating point numbers
    in C

    comparing floating point numbers

    i am posting codes and they give striking results can someone please explain why ???

    [code=c]main()
    { float a=0.7 ;
    if (a<0.7)
    { printf("c") ;
    }
    else
    printf("c++") ;
    }
    [/code]OUTPUT is c
    [code=c]main()
    { float a=0.7 ;
    if (a<0.7f)
    { printf("c") ;
    }
    else
    printf("c++")...
    See more | Go to post
    Last edited by AdrianH; Jun 3 '07, 04:41 PM. Reason: Please use [code=c][/code] tags to improve readability
No activity results to display
Show More
Working...