Reputation: 485
$k = bcmul(PHP_INT_MAX ,PHP_INT_MAX);
echo number_format($k,0,'','');
How can I display the exact result of $k?
I know that php converts an integer into a float whenever it exceeds the maximum value but I still don't get the right result from the above multiplication.
Upvotes: 0
Views: 100
Reputation: 20737
Why do you need number_format($k,0,'','');
??
Just:
echo bcmul(PHP_INT_MAX ,PHP_INT_MAX);
Upvotes: 2
Reputation: 46
Print the value as string (reference: http://php.net/manual/en/function.bcmul.php#110658)
printf('%s', $k);
Upvotes: -1