namespace cpp {}

C++ lernen, kennen, anwenden

Benutzer-Werkzeuge

Webseiten-Werkzeuge


Action disabled: source
kennen:lib:isnormal

isnormal()

#include <cmath>

bool isnormal (double x)

Liefert true, wenn die Gleitkommazahl x normalisiert ist.

Parameter

zahl Gleitkommazahl

Ergebnis

Rückgabewert: true, wenn zahl intern in der Form $(-1)^s\cdot 1.m\cdot 2^e$ normalisiert dargestellt ist.

Siehe auch

Beispiel

isnormal.cpp
#include <cmath>
#include <iostream>
 
void properties(double x)
{
  std::cout << std::isnormal(x) << '\t'
            << std::isfinite(x) << '\t'
            << std::isinf(x) << '\t'
            << std::isnan(x) << '\t'
            << !std::isunordered(x,x) << '\t'
            << std::signbit(x) << '\t'
						<< x << '\n';
}
 
int main()
{
  std::cout << std::boolalpha
            << "normal\tfinite\tinf\tNaN\tordered\tsignbit\tx\n\n";
 
  properties(0.0);
  properties(1.0);
  properties(1.0/0.0);
  properties(0.0/0.0);
 
  properties(-0.0);
  properties(-1.0);
  properties(-1.0/0.0);
  properties(-0.0/0.0);
 
  properties(HUGE_VAL);
  properties(INFINITY);
  properties(NAN);
}
kennen/lib/isnormal.txt · Zuletzt geändert: 2019-11-20 15:42 von 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki