Rounding a floating point number declared in "double"

Discussion in 'C Programming' started by Sooha Park Lee, Jul 16, 2003.

  1. I just fount out that most of machines provide standard macros
    handling "floating-point comparison"
    such as "isgreater()", "isgreaterequal()"...

    Thx.

    -S
     
    Sooha Park Lee, Jul 16, 2003
    #1
    1. Advertising

  2. Sooha Park Lee

    Mark Gordon Guest

    On Wed, 16 Jul 2003 19:09:41 +0000 (UTC)
    (Sooha Park Lee) wrote:

    > I just fount out that most of machines provide standard macros
    > handling "floating-point comparison"
    > such as "isgreater()", "isgreaterequal()"...


    Strange that of the two compilers I've got that only one defines it
    then...

    They are also not mentioned in K&R2 so I doubt that they are part of the
    C90 standard which is what most implementations provide.
    --
    Mark Gordon
    Paid to be a Geek & a Senior Software Developer
    Although my email address says spamtrap, it is real and I read it.
     
    Mark Gordon, Jul 16, 2003
    #2
    1. Advertising

  3. Sooha Park Lee

    martinh Guest

    Mark Gordon <> wrote in message news:<>...
    > On Wed, 16 Jul 2003 19:09:41 +0000 (UTC)
    > (Sooha Park Lee) wrote:
    >
    > > I just fount out that most of machines provide standard macros
    > > handling "floating-point comparison"
    > > such as "isgreater()", "isgreaterequal()"...

    >
    > Strange that of the two compilers I've got that only one defines it
    > then...
    >
    > They are also not mentioned in K&R2 so I doubt that they are part of the
    > C90 standard which is what most implementations provide.


    Those aren't, in fact, part of C90, but are in C99's features to
    support IEEE arithmetic. Anyway, the macros are intended to perform
    comparisons without raising floating point exceptions (in case one of
    the arguments is a NaN) and have nothing to do with handling of
    rounding errors.
     
    martinh, Jul 17, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sooha Park Lee

    Rounding a floating point number declared in "double"

    Sooha Park Lee, Jul 16, 2003, in forum: C Programming
    Replies:
    2
    Views:
    504
    Mark McIntyre
    Jul 16, 2003
  2. hg

    floating point rounding

    hg, Mar 9, 2007, in forum: Python
    Replies:
    4
    Views:
    336
  3. Floating point rounding error

    , Jun 16, 2007, in forum: C Programming
    Replies:
    15
    Views:
    1,952
    Jean-Marc Bourguet
    Jul 2, 2007
  4. jacob navia

    Rounding a floating point number

    jacob navia, Feb 25, 2008, in forum: C Programming
    Replies:
    21
    Views:
    870
    Bartc
    Feb 28, 2008
  5. Saraswati lakki
    Replies:
    0
    Views:
    1,428
    Saraswati lakki
    Jan 6, 2012
Loading...

Share This Page