OiO.lk Blog PHP How to use sqrt in gmp without loosing data?
PHP

How to use sqrt in gmp without loosing data?


I am working with big integer.

I have two equations:

  1. $n = m^4 = "66288484664777839292466735359294353535658376759494957"
  2. x = 4m – 11

To solve it I am using gmp_sqrt (two times)

   $m = gmp_sqrt(gmp_sqrt($n));

After that I am putting value of $m in equation 2. But it is not giving me the desired result because gmp_sqrt is ignoring decimal part. How could I get desired value working in GMP environment?



You need to sign in to view this answers

Exit mobile version