bcmath Questions

4

I'm using an Ubuntu 16 server for testing with php7.1. One of my app uses bcadd function. I know that I need to install bcmath module for that but I'm unable to find php7.1-bcmath. When I tried to ...
Endo asked 11/5, 2017 at 2:36

2

I am getting below error while installing bcmath root@cfe90ea33de0:/var/www/web# apt install php-bcmath Reading package lists... Done Building dependency tree Reading state information... Done Pa...
Cotopaxi asked 2/3, 2020 at 6:39

6

Solved

I need to mimic the exact functionality of the ceil(), floor() and round() functions on bcmath numbers, I've already found a very similar question but unfortunately the answer provided isn't good e...
Interlanguage asked 29/10, 2009 at 9:53

19

How do I install the bcmath module on a server? I tried yum update php-bcmath but it said it found nothing.
Hive asked 3/8, 2010 at 20:5

2

Solved

After installed "eduTrac SIS" and accessing "dashboard" got this error Ubuntu 16.4, PHP 7.0(php7.0-fpm), Apache2, Nginx, URL gives error 500 and nginx/error.log displays, FastCGI sent in stde...
Conchiferous asked 29/6, 2018 at 4:14

14

Solved

I'm looking for a way to generate a big random number with PHP, something like: mt_rand($lower, $upper); The closer I've seen is gmp_random() however it doesn't allow me to specify the lower and...
Nonviolence asked 25/9, 2009 at 22:23

3

Solved

Is there any library function for this purpose, so I don't do it by hand and risk ending in TDWTF? echo ceil(31497230840470473074370324734723042.6); // Expected result 314972308404704730743703247...
Afterburning asked 23/10, 2008 at 19:15

2

Solved

We are looking for the Nth root in PHP. We need to do this with a very large number, and the windows calculator returns 2. With the following code we are getting 1. Does anybody have an idea how th...
Barehanded asked 28/6, 2012 at 10:43

2

Solved

How do I get the scale set in BCMath's bcscale() method? Example: bcscale(25); How do I get the 25? Thanks!
Fibro asked 23/7, 2013 at 11:47

1

I am getting this error PHP Fatal error: Call to undefined function bccomp() I am using Ubuntu, and I installed PHP-5.6 using APT-GET command
Kinson asked 18/5, 2017 at 13:57

3

Solved

I'm doing a calculation in PHP using bcmath, and need to raise e by a fractional exponent. Unfortunately, bcpow() only accepts integer exponents. The exponent is typically higher precision than a f...
Cognac asked 2/11, 2015 at 20:23

2

Solved

I need to enable BC Math, but I don't want to do it using --enable-bcmath, primarily because I don't understand that route. Is there a way to do this using php.ini only?
Brahe asked 25/4, 2013 at 14:44

1

Solved

I have about 10-15 numbers with precision of 1, 2 or 3 decimals in my db, both signed and unsigned. Example of datatypes being used: decimal(10,3), decimal(10,2), decimal(10,1) I'm calculating...
Presber asked 19/5, 2014 at 8:5

1

Solved

Using bcdiv, i can't divide with small float using scientific notation : Working code : bcscale(30); $a = '1' ; $b = '0.00000001'; $result = bcdiv($a, $b); var_dump($result); Results in : ...
Vibrio asked 19/2, 2014 at 16:20

2

Solved

I'm currently trying to figure out how to work with arbitrary-precision numbers in PHP. So I guess my first question would be what exactly is arbitrary-precision math. I tried Googling for a good d...
Etsukoetta asked 5/8, 2011 at 19:35

1

Solved

I'm writing a wrapper for the bcmath extension, and bug #10116 regarding bcpow() is particularly annoying -- it casts the $right_operand ($exp) to an (native PHP, not arbitrary length) integer, so ...
Thyroiditis asked 9/5, 2012 at 19:49

1

I'm writing a PHP library that has a Number class that uses the bcmath extension for arbitrary precision. I have two questions: How much slower is bcmath compared to using the built-in int and flo...
Bragg asked 15/2, 2010 at 7:6
1

© 2022 - 2024 — McMap. All rights reserved.