-1

I searched and I found that I can use number_format function in php. But it can't even store 1 million digits . I am getting output as inf. Can someone help me please. If it's not possible in php then can it be done in C++ or Java ?

Update: I am using GMP but when I run script browser sent me response as "this site can't be reached, connection was reset". I disabled max execution time but it gives me same error. What should I do? Do I need to do any other changes in configuration?

Guest
  • 7
  • 6
  • 1
    What do you need to do with the number? If you just need to store it you could possibly just use a string. – Jerome Aug 16 '19 at 04:45
  • I want to divide that number by other small numbers so I can't store it as string. Please give me other solution – Guest Aug 16 '19 at 04:47
  • 1
    Have you looked into any of the [math](https://www.php.net/manual/en/intro.bc.php) extensions that are [available](https://www.php.net/manual/en/intro.gmp.php)? – msg Aug 16 '19 at 04:51

1 Answers1

-1

There is bigint choice in phpmyadmin
Laravel has that too, and you can do it in terminal

bigint is great but rarely used


Updated

you can use float and set value limit

In this picture I used float and defined the value limit to 20

In this picture I used float and defined the value limit to 20

Hope that helps

Xanonz
  • 52
  • 7
  • 1
    MySQL's BigInt can hold numbers up to 2^64-1, which is not enough for the millions of digits OP wants to store. – Sirko Aug 16 '19 at 05:08