> Indeed I wasn't aware of this bug report. It seems as if your patch is fine
> although I could only look at it briefly.
> It does look strange that you need to initialize the resulting scale
> manually. I thought the BC functions are supposed to take care of returning
> the results as the right scale.
>
The BC functions will predeict the required scale of the output, but the
numbers have to be in bc_num format going in and str2num requires that you
specify a scale.

> In any case, it probably makes sense for you to go ahead and commit it.
>
Will do.

> BTW, is php_str2num() only supposed to work on whole or decimal values?
> What about exponents?
>
bc_str2num() only allows whole or decimal values so that's all I wrote
php_str2num to allow for.
By 'exponents' do you mean scientific notation?  I don't see any support
for that in the bc conversion functions.  I don't suppose it would take
much to add that capability, but that'd be a feature change and should
probably be done separately (and only in HEAD).

-Pollita




-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to