Namespaces
Variants

isless

From cppreference.net
< c ‎ | numeric ‎ | math
Common mathematical functions
Functions
Basic operations
(C99)
(C99)
(C99)
(C99) (C99) (C99) (C23)
Maximum/minimum operations
Exponential functions
Power functions
Trigonometric and hyperbolic functions
Nearest integer floating-point
(C99) (C99) (C99)
(C23) (C23) (C23) (C23)
Floating-point manipulation
Narrowing operations
(C23)
(C23)
(C23)
(C23)
(C23)
(C23)
Quantum and quantum exponent
Decimal re-encoding functions
Total order and payload functions
Classification
Error and gamma functions
(C99)
(C99)
(C99)
(C99)
Types
Macro constants
Special floating-point values
Arguments and return values
Error handling
Fast operation indicators
Definiert in Header <math.h>
#define isless(x, y) /* implementation defined */
(seit C99)

Bestimmt, ob die Gleitkommazahl x kleiner ist als die Gleitkommazahl y , ohne Gleitkomma-Ausnahmen auszulösen.

Inhaltsverzeichnis

Parameter

x - Gleitkommawert
y - Gleitkommawert

Rückgabewert

Ein von Null verschiedener ganzzahliger Wert, wenn x < y , 0 andernfalls.

Hinweise

Der eingebaute operator < für Gleitkommazahlen kann FE_INVALID auslösen, wenn eines oder beide Argumente NaN ist. Diese Funktion ist eine "ruhige" Version von operator < .

Beispiel

#include <math.h>
#include <stdio.h>
int main(void)
{
    printf("isless(2.0,1.0)      = %d\n", isless(2.0, 1.0));
    printf("isless(1.0,2.0)      = %d\n", isless(1.0, 2.0));
    printf("isless(INFINITY,1.0) = %d\n", isless(INFINITY, 1.0));
    printf("isless(1.0,NAN)      = %d\n", isless(1.0, NAN));
    return 0;
}

Mögliche Ausgabe:

isless(2.0,1.0)      = 0
isless(1.0,2.0)      = 1
isless(INFINITY,1.0) = 0
isless(1.0,NAN)      = 0

Referenzen

  • C23-Standard (ISO/IEC 9899:2024):
  • 7.12.14.3 Die isless-Makro (S: TBD)
  • F.10.11 Vergleichsmakros (S: TBD)
  • C17-Standard (ISO/IEC 9899:2018):
  • 7.12.14.3 Die isless-Makro (S.: TBD)
  • F.10.11 Vergleichsmakros (S.: TBD)
  • C11 Standard (ISO/IEC 9899:2011):
  • 7.12.14.3 Die isless-Makro (S. 260)
  • F.10.11 Vergleichsmakros (S. 531)
  • C99-Standard (ISO/IEC 9899:1999):
  • 7.12.14.3 Die isless-Makro (S: 241)

Siehe auch

prüft, ob das erste Gleitkomma-Argument größer als das zweite ist
(Funktionsmakro)