Skip to content

Conversation

cmb69
Copy link
Member

@cmb69 cmb69 commented Sep 8, 2017

We change bcmul() and bcpow() so that the result has exactly the
requested scale (i.e. decimal places) to make them consistent with the
other BCMath functions. This also changes our stance regarding bug
#52748, which had been classified as documentation problem.

We do not manipulate the numbers themselves (anymore), but rather
introduce bc_num2str_ex() which accepts a scale parameter that
overrides the scale of the number by omitting extraneous decimals and
adding zeros, respectively. This also allows us to get rid of
split_bc_num(), which fixes bug #75164 as well.

We change `bcmul()` and `bcpow()` so that the result has exactly the
requested scale (i.e. decimal places) to make them consistent with the
other BCMath functions.  This also changes our stance regarding bug
#52748, which had been classified as documentation problem.

We do not manipulate the numbers themselves (anymore), but rather
introduce `bc_num2str_ex()` which accepts a scale parameter that
overrides the scale of the number by omitting extraneous decimals and
adding zeros, respectively.  This also allows us to get rid of
`split_bc_num()`, which fixes bug #75164 as well.
@nikic
Copy link
Member

nikic commented Sep 8, 2017

Nice, I like this solution.

@cmb69 cmb69 mentioned this pull request Sep 10, 2017
@krakjoe krakjoe added the Bug label Sep 11, 2017
@cmb69
Copy link
Member Author

cmb69 commented Sep 18, 2017

Since there are no objections, I'm going to merge to master soon.

@php-pulls php-pulls merged commit 870ed51 into php:master Sep 18, 2017
@cmb69
Copy link
Member Author

cmb69 commented Sep 18, 2017

FTR: added note to UPGRADING (de2dc91) and updated the manual.

@cmb69 cmb69 deleted the bug66364 branch September 18, 2017 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants