log1p() 函數是預定義的 php 數學函數,它返回 log(1+number)。即使 $number 的值接近於零,它的計算也是準確的。
用法:
log1p(number);
參數 | 描述 | 必需/可選 |
---|---|---|
Number | 指定要處理的數量 | Required |
示例 1
<?php
$num=6;
echo "Your number is:".$num;
echo "<br>"."By using log10() function your number is:".log1p($num);
?>
輸出:
Your number is:6 By using log10() function your number is:1.9459101490553
例2
<?php
$num=(-0.3);
echo "Your number is:".$num;
echo "<br>"."By using log10() function your number is:".log1p($num);
?>
輸出:
Your number is:-0.3 By using log10() function your number is:-0.35667494393873
例3
<?php
$num=(2.7183);
echo "Your number is:".$num;
echo "<br>"."By using log10() function your number is:".log1p($num);
?>
輸出:
Your number is:2.7183 By using log10() function your number is:1.3132665745863
例4
<?php
$num=0;
echo "Your number is:".$num;
echo "<br>"."By using log10() function your number is:".log1p($num);
?>
輸出:
Your number is:0 By using log10() function your number is:0
相關用法
- PHP log10()用法及代碼示例
- PHP log()用法及代碼示例
- PHP long2ip()用法及代碼示例
- PHP localtime()用法及代碼示例
- PHP ltrim()用法及代碼示例
- PHP lcg_value()用法及代碼示例
- PHP lstat( )用法及代碼示例
- PHP list()用法及代碼示例
- PHP link( )用法及代碼示例
- PHP lcfirst()用法及代碼示例
- PHP levenshtein()用法及代碼示例
- PHP SimpleXMLElement children()用法及代碼示例
- PHP PHPUnit assertIsNotFloat()用法及代碼示例
- PHP ReflectionClass getTraitAliases()用法及代碼示例
- PHP hash_hmac()用法及代碼示例
- PHP String wordwrap()用法及代碼示例
- PHP imagecreatefromstring()用法及代碼示例
- PHP is_file( )用法及代碼示例
- PHP ArrayIterator asort()用法及代碼示例
- PHP IntlCalendar getTimeZone()用法及代碼示例
注:本文由純淨天空篩選整理自 PHP log1p() Function。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。