日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

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

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

python中acosh

C ++ acosh()函數 (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()函數是CMATH報頭的庫函數,它被用于查找給定值的非負區域雙曲余弦,它接受一個數字(x)和返回x的非負區域雙曲余弦。

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的值不應小于1,如果參數小于0,則它將返回域錯誤( -nan )。

Syntax of acosh() function:

acosh()函數的語法:

acosh(x);

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

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

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

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

Example:

例:

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

C ++代碼演示acosh()函數的示例 (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()函數

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

python中acosh

總結

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

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。