C ++ acosh () - C ++ standaardbibliotheek

De functie acosh () in C ++ retourneert de arc hyperbolische cosinus (inverse hyperbolische cosinus) van een getal in radialen.

De functie acosh () gebruikt één argument en retourneert de hyperbolische boogcosinus van die waarde in radialen.

De functie is gedefinieerd in het header-bestand.

(Wiskunde) cosh -1 x = acosh (x) (in C ++ programmeren)

acosh () prototype (vanaf C ++ 11-standaard)

dubbele acosh (dubbele x); float acosh (float x); lange dubbele acosh (lange dubbele x); dubbele acosh (T x); // Voor integraal type

acosh () Parameters

De functie acosh () accepteert één verplicht argument dat groter is dan of gelijk is aan 1.

Als het argument kleiner is dan 1, treedt er een domeinfout op.

acosh () Retourwaarde

De functie acosh () retourneert een waarde in het bereik (0, ∞) .

Als het argument dat wordt doorgegeven aan acosh () kleiner is dan 1, wordt geretourneerd NaN(geen getal).

acosh () Retourwaarden
Parameter Winstwaarde
x> = 1 (0, ∞)
x <1 NaN

Voorbeeld 1: Hoe werkt de functie 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; )

Wanneer u het programma uitvoert, is de uitvoer:

 acosh (x) = 3,27269 radialen acosh (x) = 187,511 graden 

Voorbeeld 2: acosh () functie met integraal type

 #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; ) 

Wanneer u het programma uitvoert, is de uitvoer:

 acosh (x) = 2.06344 radialen acosh (x) = 118.226 graden 

Interessante artikelen...