C ++ acosh () - C ++ Standardbibliothek

Die Funktion acosh () in C ++ gibt den bogenhyperbolischen Kosinus (inversen hyperbolischen Kosinus) einer Zahl im Bogenmaß zurück.

Die Funktion acosh () verwendet ein einzelnes Argument und gibt den bogenhyperbolischen Kosinus dieses Werts im Bogenmaß zurück.

Die Funktion ist in der Header-Datei definiert.

(Mathematik) cosh -1 x = acosh (x) (In der C ++ - Programmierung)

acosh () Prototyp (Stand C ++ 11 Standard)

Doppel-Acosh (doppeltes x); float acosh (float x); langes doppeltes acosh (langes doppeltes x); Doppelacosh (T x); // Für integralen Typ

acosh () Parameter

Die Funktion acosh () verwendet ein einzelnes obligatorisches Argument, das größer oder gleich 1 ist.

Wenn das Argument kleiner als 1 ist, tritt ein Domänenfehler auf.

acosh () Rückgabewert

Die Funktion acosh () gibt einen Wert im Bereich (0, ∞) zurück .

Wenn das an acosh () übergebene Argument kleiner als 1 ist, wird es zurückgegeben NaN(keine Zahl).

acosh () Rückgabewerte
Parameter Rückgabewert
x> = 1 (0, ∞)
x <1 NaN

Beispiel 1: Wie funktioniert die Funktion acosh () in C ++?

 #include #include #define PI 3.141592654 using namespace std; int main() ( double x = 13.21, result; result = acosh(x); cout << "acosh(x) = " << result << " radian" << endl; // result in degrees cout << "acosh(x) = " << result*180/PI << " degree" << endl; return 0; )

Wenn Sie das Programm ausführen, lautet die Ausgabe wie folgt:

 acosh (x) = 3,27269 radian acosh (x) = 187,511 Grad 

Beispiel 2: acosh () -Funktion mit ganzzahligem Typ

 #include #include #define PI 3.141592654 using namespace std; int main() ( int x = 4; double result; result = acosh(x); cout << "acosh(x) = " << result << " radian" << endl; // result in degrees cout << "acosh(x) = " << result*180/PI << " degree" << endl; return 0; ) 

Wenn Sie das Programm ausführen, lautet die Ausgabe wie folgt:

 acosh (x) = 2,06344 radian acosh (x) = 118,226 Grad 

Interessante Beiträge...