How to work with big numbers in PHP?
such as
(6*27^0+17*27^1+11*27^2+18*27^3+25*27^4+4*27^5)^65537
echo (int) ( (0.1+0.7) * 10 ); // echoes 7!
PHP Floats The float data type can commonly store a value up to 1.7976931348623E+308 (platform dependent), and have a maximum precision of 14 digits.
PHP is able to perform complex calculations quickly and provides many more tools to write whichever calculations are needed. Exponents, percentage, square root, and many more operations are possible.
PHP converts the string to an int, which is 0 (as it doesn't contain any number representation).
You can go for BCMath to work with big numbers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With