Can someone explain to me if I should use bcpow() instead of pow() and why?
I understand that not all installations of php have bcmath enabled. So if I write an open source project, and want to have as few dependencies/requirements as possible, I would rather use pow() in my code.
But what are the downsides to using pow() over bcpow()?
bcpow()
is a function of the BCMath Arbitrary Precision Mathematics library.
Quoting the introduction of it's manual :
For arbitrary precision mathematics PHP offers the Binary Calculator which supports numbers of any size and precision, represented as strings.
The size of a float is platform-dependent, although a maximum of ~1.8e308 with a precision of roughly 14 decimal digits is a common value (the 64 bit IEEE format)