Search code examples
phpgmp

How can I determine if a number is an integer with PHP GMP


I have a GMP object and I need to do

if(is_int($a)){ 
   /*Do something*/ 
}

I tried converting it to an int and checking wether it's the same t gmp_cmp, but that isn't working for me.


Solution

  • Turns out PHP GMP only does integers; The values were getting mangled.