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

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

安卓log.e函数打印示例_log1p()函数以及C ++中的示例

發布時間:2023/12/1 编程问答 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 安卓log.e函数打印示例_log1p()函数以及C ++中的示例 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

安卓log.e函數打印示例

C ++ log1p()函數 (C++ log1p() function)

log1p() function is a library function of cmath header, it is used to get the natural logarithm (the base-e logarithm) of the one plus given value. It accepts a value (float, double, or long double) and returns the natural logarithm.

log1p()函數是cmath標頭的庫函數,用于獲取1加給定值的自然對數(以e為底的對數)。 它接受一個值( float , double或long double )并返回自然對數。

Syntax of log1p() function:

log1p()函數的語法:

C++11:

C ++ 11:

double log1p (double x);float log1p (float x); long double log1p (long double x);double log1p (T x);

Parameter(s):

參數:

  • x – represents the value whose natural logarithm to be found.

    x –表示要找到其自然對數的值。

Return value:

返回值:

It returns the natural logarithm of the one plus given value x.

它返回1加給定值x的自然對數。

Note:

注意:

  • If the given value is less than -1, it causes a domain error.

    如果給定值小于-1,則將導致域錯誤。

  • If the given value is -1, it may cause a pole error.

    如果給定值為-1,則可能會導致磁極誤差。

Example:

例:

Input:float x = 1.0fFunction call:log1p(x);Output:0.693147

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

// C++ code to demonstrate the example of // log1p() function#include <iostream> #include <cmath> using namespace std;int main() {float x = 0.0f;x = 10.0f;cout << "log1p(" << x << "): " << log1p(x) << endl;x = 1.0f;cout << "log1p(" << x << "): " << log1p(x) << endl;x = 20.0f;cout << "log1p(" << x << "): " << log1p(x) << endl;x = -10.4f;cout << "log1p(" << x << "): " << log1p(x) << endl;x = 0.0f;cout << "log1p(" << x << "): " << log1p(x) << endl;x = 100.6f;cout << "log1p(" << x << "): " << log1p(x) << endl;return 0; }

Output

輸出量

log1p(10): 2.3979 log1p(1): 0.693147 log1p(20): 3.04452 log1p(-10.4): -nan log1p(0): 0 log1p(100.6): 4.62104

Reference: C++ log1p() function

參考: C ++ log1p()函數

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

安卓log.e函數打印示例

總結

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

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