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

Division by zero #83

Closed
mikaelcom opened this issue Aug 3, 2016 · 6 comments
Closed

Division by zero #83

mikaelcom opened this issue Aug 3, 2016 · 6 comments

Comments

@mikaelcom
Copy link

Hi,

I'm facing an issue on PHP 5.5.9-1ubuntu4.19 (cli) when using NumberHumanizer::binarySuffix as I'm having a PHP warning saying Division by zero.

I digged by myself and found that the array

private $binaryPrefixes = array(
        1125899906842624 => '#.## PB',
        1099511627776 => '#.## TB',
        1073741824 => '#.## GB',
        1048576 => '#.## MB',
        1024 => '#.# kB',
        0 => '# bytes',
    );

is actually returned such as

Array
(
    [0] => # bytes
    [1073741824] => #.## GB
    [1048576] => #.## MB
    [1024] => #.# kB
)

Did anyone faced this issue already?

Thanks by the way

@norberttech
Copy link
Member

Hey @mikaelcom could you also put here some code examples that throws this warning?

@mikaelcom
Copy link
Author

I'm using the NumberHumanizer::binarySuffix(86450) for example and this throws this warning

@norberttech
Copy link
Member

@mikaelcom as you can see in #86 I'm not able to reproduce that issue : <

@norberttech
Copy link
Member

Closing since I'm not able to reproduce that issue.

@mikaelcom
Copy link
Author

Hi,
I have a clue, I tested it under a 32-bit OS 😉

@norberttech
Copy link
Member

Ok, so I'm reopening it

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

No branches or pull requests

2 participants