Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Rounding a floating point number declared in "double"

Reply
Thread Tools

Rounding a floating point number declared in "double"

 
 
Sooha Park Lee
Guest
Posts: n/a
 
      07-16-2003
I just fount out that most of machines provide standard macros
handling "floating-point comparison"
such as "isgreater()", "isgreaterequal()"...

Thx.

-S
 
Reply With Quote
 
 
 
 
Mark Gordon
Guest
Posts: n/a
 
      07-16-2003
On Wed, 16 Jul 2003 19:09:41 +0000 (UTC)
http://www.velocityreviews.com/forums/(E-Mail Removed) (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.
 
Reply With Quote
 
 
 
 
martinh
Guest
Posts: n/a
 
      07-17-2003
Mark Gordon <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> On Wed, 16 Jul 2003 19:09:41 +0000 (UTC)
> (E-Mail Removed) (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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rounding a floating point number jacob navia C Programming 21 02-28-2008 01:47 AM
Floating point subtraction rounding error (NOT display error) Keflavich Python 13 12-14-2007 03:56 PM
Floating point rounding error Mukesh_Singh_Nick@yahoo.com C Programming 15 07-02-2007 08:11 AM
floating point rounding hg Python 4 03-10-2007 09:33 AM
Rounding a floating point number declared in "double" Sooha Park Lee C Programming 2 07-16-2003 09:37 PM



Advertisments