日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 >

python中acosh_acosh()函数以及C ++中的示例

發(fā)布時間:2025/3/11 65 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python中acosh_acosh()函数以及C ++中的示例 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

python中acosh

C ++ acosh()函數(shù) (C++ acosh() function)

acosh() function is a library function of cmath header, it is used to find nonnegative area hyperbolic cosine of the given value, it accepts a number (x) and returns the nonnegative area hyperbolic cosine of x.

ACOSH()函數(shù)是CMATH報頭的庫函數(shù),它被用于查找給定值的非負區(qū)域雙曲余弦,它接受一個數(shù)字(x)和返回x的非負區(qū)域雙曲余弦。

Note: Value of the x should not be less than the 1, if arguments are less than 0, it returns a domain error (-nan).

注意: x的值不應(yīng)小于1,如果參數(shù)小于0,則它將返回域錯誤( -nan )。

Syntax of acosh() function:

acosh()函數(shù)的語法:

acosh(x);

Parameter(s): x – is the number/value whose nonnegative area hyperbolic cosine is calculated.

參數(shù): x –是計算其非負面積雙曲余弦的數(shù)字/值。

Return value: double – it returns double type value that is the nonnegative area hyperbolic cosine of the given number/value x.

返回值: double-返回double類型的值,它是給定數(shù)字/值x的非負面積雙曲余弦值。

Example:

例:

Input:float x = 2.45;Function call:acosh(x); Output:1.54471

C ++代碼演示acosh()函數(shù)的示例 (C++ code to demonstrate the example of acosh() function)

// C++ code to demonstrate the example of // acosh() function#include <iostream> #include <cmath> using namespace std;// main() section int main() {float x;x = 1.0;cout<<"acosh("<<x<<"): "<<acosh(x)<<endl;x = 10.23;cout<<"acosh("<<x<<"): "<<acosh(x)<<endl; x = 2.45;cout<<"acosh("<<x<<"): "<<acosh(x)<<endl; return 0; }

Output

輸出量

acosh(1): 0 acosh(10.23): 3.01607 acosh(2.45): 1.54471

Example with domain error

域錯誤示例

If we provide the value less than 1, it returns -nan.

如果提供的值小于1,則返回-nan 。

// C++ code to demonstrate the example of // acosh() function#include <iostream> #include <cmath> using namespace std;// main() section int main() {float x;//no error with this input valuex = 1.0;cout<<"acosh("<<x<<"): "<<acosh(x)<<endl;//domain error with this input valuex = 0.25;cout<<"acosh("<<x<<"): "<<acosh(x)<<endl; return 0; }

Output

輸出量

acosh(1): 0 acosh(0.25): -nan

Reference: C++ acosh() function

參考: C ++ acosh()函數(shù)

翻譯自: https://www.includehelp.com/cpp-tutorial/acosh-function-with-example.aspx

python中acosh

總結(jié)

以上是生活随笔為你收集整理的python中acosh_acosh()函数以及C ++中的示例的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。