Rounding a floating point number declared in "double"

S

Sooha Park Lee

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

Thx.

-S
 
M

Mark Gordon

On Wed, 16 Jul 2003 19:09:41 +0000 (UTC)
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.
 
M

martinh

Mark Gordon said:
On Wed, 16 Jul 2003 19:09:41 +0000 (UTC)


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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top