Arbitrary-Precision Math in PHP

Viewed 5335

I'm currently trying to figure out how to work with arbitrary-precision numbers in PHP. So I guess my first question would be what exactly is arbitrary-precision math. I tried Googling for a good definition but for some reason nobody can put it in simple enough words.

Second, what are the differences between the BCMath and GMP libraries in PHP? I've heard claims that GMP's API is "fresher", but idk. Is one better?

And my final question would be what type of numbers BCMath/GMP takes. Obviously it takes normal integers in string form (e.g. "5.34"), but I've seen implementations where BCMath functions have been used directly with octet strings representing regular integers (e.g. "\x12\x23\x45\x67"), which I've heard as being called "bigint", but again Google has yielded nothing for me.

2 Answers
Related