isnormal
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Definiert im Header
<math.h>
|
||
|
#define isnormal(arg) /* implementation defined */
|
(seit C99) | |
Bestimmt, ob die gegebene Gleitkommazahl
arg
normal ist, d.h. weder Null, subnormal, unendlich noch
NaN
ist. Das Makro gibt einen ganzzahligen Wert zurück.
FLT_EVAL_METHOD wird ignoriert: selbst wenn das Argument mit größerer Reichweite und Genauigkeit als sein Typ ausgewertet wird, wird es zuerst in seinen semantischen Typ konvertiert, und die Klassifizierung basiert darauf.
Inhaltsverzeichnis |
Parameter
| arg | - | Gleitkommawert |
Rückgabewert
Nicht-Null-Ganzzahlwert, falls arg normal ist, 0 andernfalls.
Beispiel
#include <float.h> #include <math.h> #include <stdio.h> int main(void) { printf("isnormal(NAN) = %d\n", isnormal(NAN)); printf("isnormal(INFINITY) = %d\n", isnormal(INFINITY)); printf("isnormal(0.0) = %d\n", isnormal(0.0)); printf("isnormal(DBL_MIN/2.0) = %d\n", isnormal(DBL_MIN / 2.0)); printf("isnormal(1.0) = %d\n", isnormal(1.0)); }
Ausgabe:
isnormal(NAN) = 0 isnormal(INFINITY) = 0 isnormal(0.0) = 0 isnormal(DBL_MIN/2.0) = 0 isnormal(1.0) = 1
Referenzen
- C23-Standard (ISO/IEC 9899:2024):
-
- 7.12.3.5 Das isnormal-Makro (S.: TBD)
- C17-Standard (ISO/IEC 9899:2018):
-
- 7.12.3.5 The isnormal macro (p: TBD)
- C11-Standard (ISO/IEC 9899:2011):
-
- 7.12.3.5 Die isnormal-Makro (S: 237)
- C99-Standard (ISO/IEC 9899:1999):
-
- 7.12.3.5 Das isnormal-Makro (S: 217-218)
Siehe auch
|
(C99)
|
klassifiziert den gegebenen Gleitkommawert
(Funktionsmakro) |
|
(C99)
|
prüft, ob die gegebene Zahl einen endlichen Wert hat
(Funktionsmakro) |
|
(C99)
|
prüft, ob die gegebene Zahl unendlich ist
(Funktionsmakro) |
|
(C99)
|
prüft, ob die gegebene Zahl NaN ist
(Funktionsmakro) |
|
C++ documentation
für
isnormal
|
|