Skip to content

fix petabyte-precision - #18

Open
lucajackal85 wants to merge 4 commits into
gabrielelana:masterfrom
lucajackal85:master
Open

fix petabyte-precision#18
lucajackal85 wants to merge 4 commits into
gabrielelana:masterfrom
lucajackal85:master

Conversation

@lucajackal85

@lucajackal85 lucajackal85 commented Jan 16, 2021

Copy link
Copy Markdown

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.

1 participant