Skip to content

Commit

Permalink
Merge pull request box#107 from mushak/fix-bcmath-scale
Browse files Browse the repository at this point in the history
Use explicit scale value when calling bcmath functions (fixes box#106)
  • Loading branch information
gtowey committed Jul 14, 2014
2 parents 728f9c0 + 9549858 commit 3740bdc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Anemometer.php
Original file line number Diff line number Diff line change
Expand Up @@ -714,9 +714,9 @@ private function bchexdec($hex) {

$dec = 0;

for ($i = strlen($hex) - 1, $e = 1; $i >= 0; $i--, $e = bcmul($e, 16)) {
for ($i = strlen($hex) - 1, $e = 1; $i >= 0; $i--, $e = bcmul($e, 16, 0)) {
$factor = $hexdec[$hex[$i]];
$dec = bcadd($dec, bcmul($factor, $e));
$dec = bcadd($dec, bcmul($factor, $e, 0), 0);
}

return $dec;
Expand Down

0 comments on commit 3740bdc

Please sign in to comment.