473,394 Members | 1,806 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

C99 comparison macro's

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?
Nov 13 '05 #1
2 2587
In article <e1********************************@4ax.com>, 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
Nov 13 '05 #2
Serve La <la*****@nospam.home.nl> 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
(ir*******@freenet.de)
Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
2
by: Pete | last post by:
In Access 95/97 I used to be able to create pull down menus (File,Edit ...) from a macro. It seems there used to be some wizard for that. However in Access 2000 it seems you have to build your...
7
by: Newbie_sw2003 | last post by:
Where should I use them? I am giving you my understandings. Please correct me if I am wrong: MACRO: e.g.:#define ref-name 99 The code is substituted by the MACRO ref-name. So no overhead....
3
by: baumann | last post by:
hi all, i could not understand the "unnecessary" pointer comparison. /* 207 * min()/max() macros that also do 208 * strict type-checking.. See the 209 * "unnecessary" pointer comparison....
7
by: Erik Leunissen | last post by:
L.S. How can I make certain code parts be compiled conditionally, depending on the definition of a macro such as: #define VERSION "2.3" Is it all right to do things like:
46
by: yadurajj | last post by:
Hello i am newbie trying to learn C..I need to know about string comparisons in C, without using a library function,...recently I was asked this in an interview..I can write a small program but I...
14
by: Spoon | last post by:
Hello, I've come across the following comparison function used as the 4th parameter in qsort() int cmp(const void *px, const void *py) { const double *x = px, *y = py; return (*x > *y) -...
1
by: phreaktor | last post by:
Let me begin by saying I admire the knowledge of some of you forum-goers. I have only taken an introductory couse in Visual Basic.NET as a supplement to my study of Electronics Engineering. I have...
20
by: chutsu | last post by:
I'm trying to compare between pointer and integer in an "IF" statement how do I make this work? if(patient.id != NULL){ } Thanks Chris
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.