https://www.geeksforgeeks.org/php-bcadd-function/
https://stackoverflow.com/questions/51094183/fatal-error-uncaught-error-call-to-undefined-function-bcadd
PHP does not recognize "bcadd()" gives the error. "bcadd()" function is included in "bcmath" PHP extention.
Just installing the relevant bcmath extension would solved the issue.
sudo apt-get install php7.<Your PHP version>-bcmath
Please note, you should find the correct version of bcmath extension according to your PHP version. And restart apache
sudo service apache2 restart
PHP | bcadd() Function
The bcadd() function in PHP is an inbuilt function and is used to add two arbitrary precision numbers. This function accepts two arbitrary precision numbers as strings and returns the addition of the two numbers after scaling the result to a specified precision.
Syntax:
string bcadd ( $num_str1, $num_str2, $scaleVal)
Program 1:
Output:
14
Program 2:
Output:
14.2220
No comments:
Post a Comment