Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8339021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:46:11+00:00 2026-06-09T04:46:11+00:00

In the latest C++ standard, I noticed the following macros : bool isgreater(float x,

  • 0

In the latest C++ standard, I noticed the following macros :

bool isgreater(float x, float y);
bool isgreaterequal(float x, float y);
bool isless(float x, float y);
bool islessequal(float x, float y);
bool islessgreater(float x, float y);
bool isunordered(float x, float y);

These macros are from C (7.12.14 and 7.12.14).

So, why would someone use these macros, instead of operators? Is there anything special that these macros are doing (like checking for inf), or are they the same as their corresponding operator?

C++ example :

#include <iostream>
#include <cmath>

int main()
{
  float x=0.2;
  float y=0.5;
  std::cout << x << " < " << y << " : " << std::boolalpha << std::islessequal( x, y ) << std::endl;
  std::cout << x << " < " << y << " : " << std::boolalpha << ( x <= y ) << std::endl;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T04:46:12+00:00Added an answer on June 9, 2026 at 4:46 am

    Unlike the relational operators, these macros do really only return a boolean value and do never raise any floating point exception.

    In short: You only have to deal with true/false and nothing else.


    references:

    The Open Group descriptions (not the C or C++ standard, but highly relevant in the Unix/Linux world and almost always similar to the standards):

    • http://pubs.opengroup.org/onlinepubs/009695399/functions/islessgreater.html
    • http://pubs.opengroup.org/onlinepubs/009695399/functions/isgreater.html
    • http://pubs.opengroup.org/onlinepubs/009695399/functions/isgreaterequal.html
    • http://pubs.opengroup.org/onlinepubs/009695399/functions/isless.html
    • http://pubs.opengroup.org/onlinepubs/009695399/functions/islessequal.html
    • http://pubs.opengroup.org/onlinepubs/009695399/functions/islessgreater.html
    • http://pubs.opengroup.org/onlinepubs/009695399/functions/isunordered.html

    C++ standard:

    C Library [c.math]:

    The classification/comparison functions behave the same as the C macros with the corresponding names defined in 7.12.3, Classification macros, and 7.12.14, Comparison macros in the C Standard. Each function is overloaded for the three floating-point types, as follows […]

    C standard:

    7.12.14 Comparison macros

    […] For any ordered pair of numeric values exactly one of the
    relationships — less, greater, and equal — is true. Relational operators may raise the
    ‘‘invalid’’ floating-point exception when argument values are NaNs. For a NaN and a
    numeric value, or for two NaNs, just the unordered relationship is true
    .
    The following subclauses provide macros that are quiet (non floating-point exception raising) versions of the relational operators, and other comparison macros that facilitate writing efficient code that accounts for NaNs without suffering the ‘‘invalid’’ floating-point exception. In
    the synopses in this subclause, real-floating indicates that the argument shall be an
    expression of real floating type.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using the latest SDK from Apple, I noticed that while running on the iPhone
From latest SDK, multi-touch is supported via tethered phone. I'm wondering whether it is
Where can I download the source code of the latest or standard library for
What is the correct way, according to the latest C standard, to define functions
I'm getting a very weird issue with standard ASP.NET backend code, and the latest
In the latest C++ standard it implies that: for (foo : bar) baz; is
I downloaded the latest source of mod_wsgi from https://code.google.com/p/modwsgi/source/checkout , but I can’t compile
The standard (latest version : WG14/N1256) says (6.2.1 §2) : A function prototype is
My latest Mac App got rejected from the Mac App Store. Basically it didn't
I use the latest m2eclipse to generate a standard ejb project, but then I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.