Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix petabyte-precision #18

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

lucajackal85
Copy link

@lucajackal85 lucajackal85 commented Jan 16, 2021

I cloned your repo and I found that unittest was not running properly on my local environment with php 7.4

After some research I found that the function bcpow has changed in behaviour in php versione 7.3 (see changelog here)

bcpow() now returns numbers with the requested scale. Formerly, the returned numbers may have omitted trailing decimal zeroes.

PHP >= 7.3

var_dump(bcpow(1024,5,10)); 
//string(27) "1125899906842624.0000000000"

var_dump(1 * bcpow(1024,5,10)); 
//float(1.1258999068426E+15)

PHP <7.3

var_dump(bcpow(1024,5,10));
//string(16) "1125899906842624"

var_dump(1 * bcpow(1024,5,10));
//int(1125899906842624)

I've tested the fix with php 7.4 and php 8.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant