Re: [PHP-DEV] Re: Supporting object types in BCMath

Hi Niels,

One advantage of a new API is that it could be more efficient than the current API.
The current API takes input as strings and outputs strings as a result, and therefore always has to reconstruct the BCMath internal state.
By keeping everything inside an object you could keep the internal state, improving performance.

Thanks for your feedback. I overlooked the cost of rebuilding the internal state. I'll give it a try and see if there's a significant difference in performance.

I also noticed earlier that it may be better in some convenience aspects, such as the way to compare values.

e.g.

$bcnum1 > $bcnum2 // bool

First, I'll try creating a simple prototype.

Regards.

Saki