PHP module Bcmath for Precision Computing

Source: Internet
Author: User
Tags square root

Php:bcmath

 BC is the abbreviation for binary calculator. The arguments to the bc* function are the operands plus an optional [int scale], such as String Bcadd (String $left _operand, String $right _operand[, int $scale]), if scale is not provided , the default value of Bcscale is used. Here the large number is directly represented by a string of 0-9, and the result of the calculation is also a string.   bcadd-adds two high-precision numbers  bccomp-compares two high-precision numbers, returns 1, 0, 1 bcdiv-divides two high-precision numbers  bcmod-to find high-precision digital remainder   bcmul-two high-precision numbers multiply  bcpow-to find high-precision digital exponentiation  bcpowmod-to find high-precision digital exponentiation, number theory is very common  bcscale-configuration default decimal point, equivalent to the Linux BC " Scale= " bcsqrt-for high-precision square root  bcsub-The two high-precision digital subtraction   can refer to the manual to check the application of these functions.  bcmath installation Bcmath This extension is available in PHP's compression package and needs to be recompiled before it can be supported; CDs   PHP-5.2.7/EXT/BCMATH/USR/LOCAL/PHP/BIN/PHPIZE./ Configure--with-php-config=/usr/local/php/bin/php-config make && make install (makes can get so path) so path copy to  extension path vim php.ini extension=bcmath.so restart Apach/nginx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.