Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > C99 comparison macro's

Reply
Thread Tools

C99 comparison macro's

 
 
Serve La
Guest
Posts: n/a
 
      10-11-2003
Now that implementations are becoming available, I've started to
learn more about C99.
Now I was reading about the isgreater/isgreaterequal/isless/...
macro's and I'm wondering about why they are here? What's the
difference with the normal relational operators?
 
Reply With Quote
 
 
 
 
Andreas Kahari
Guest
Posts: n/a
 
      10-11-2003
In article <(E-Mail Removed)>, Serve La wrote:
> Now that implementations are becoming available, I've started to
> learn more about C99.
> Now I was reading about the isgreater/isgreaterequal/isless/...
> macro's and I'm wondering about why they are here? What's the
> difference with the normal relational operators?



The macros does not, according to the standard, raise the
"invalid" floating-point exception when the arguments are
unordered (one of them is NaN). According to the rationale, the
macros were chosen instead of new operators like ?<, ?<=, ?>=,
and ?> since new operators for florating-point only would be a
too great a change to the base language. The macros do not work
with integers, since there is no NaN integer.

--
Andreas Kähäri
 
Reply With Quote
 
 
 
 
Irrwahn Grausewitz
Guest
Posts: n/a
 
      10-11-2003
Serve La <(E-Mail Removed)> wrote:

>Now that implementations are becoming available, I've started to
>learn more about C99.
>Now I was reading about the isgreater/isgreaterequal/isless/...
>macro's and I'm wondering about why they are here? What's the
>difference with the normal relational operators?


From ISO/IEC 9899:1999 Annex F.3:

[...]
The relational and equality operators provide IEC 60559 comparisons.
IEC 60559 identifies a need for additional comparison predicates to
facilitate writing code that accounts for NaNs. The comparison macros
(isgreater, isgreaterequal, isless, islessequal, islessgreater, and
isunordered) in <math.h> supplement the language operators to address
this need. The islessgreater and isunordered macros provide respectively
a quiet version of the <> predicate and the unordered predicate
recommended in the Appendix to IEC 60559.

Regards
--
Irrwahn
((E-Mail Removed))
 
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
Comparison of 2 files and generating the output based on comparison Deepu Perl Misc 1 02-07-2011 03:09 PM
Price Comparison Service. Best Deal. Special Coupon atBest-Price-Comparison.com rapee Digital Photography 0 03-14-2008 06:46 AM
Difference between "library parts" of C99 and "language parts" of C99 albert.neu@gmail.com C Programming 3 03-31-2007 08:14 PM
C99 struct initialization (C99/gcc) jilerner@yahoo.com C Programming 3 02-20-2006 04:41 AM
Comparison between C89 and C99 Giannis Papadopoulos C Programming 3 08-04-2005 09:25 PM



Advertisments