Skip to content

Commit 4c5c68f

Browse files
committed
Update binary tools
1 parent 5fd327f commit 4c5c68f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Utilities/BinaryTool.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ final public static function andBits($value1, $value2, $bytes)
196196
return base_convert($build, 2, 10);
197197
}
198198

199-
final public static function convertDoubleToIEEE754($doubleValue, $rounded = 8)
199+
final public static function convertDoubleToIEEE754($doubleValue)
200200
{
201201
$bits = $doubleValue;
202202
$s = ($bits >> 63) == 0 ? 1 : -1;
@@ -205,12 +205,12 @@ final public static function convertDoubleToIEEE754($doubleValue, $rounded = 8)
205205
return $s * $m * pow(2, $e - 1075);
206206
}
207207

208-
final public static function convertFloatToIEEE754($floatValue, $rounded = 8)
208+
final public static function convertFloatToIEEE754($floatValue)
209209
{
210210
$bits = $floatValue;
211211
$s = ($bits >> 31) == 0 ? 1 : -1;
212212
$e = ($bits >> 23) & 0xff;
213-
$m = ($e == 0) ? ($bits & 0x7fffff) << 1 : ($bits & 0x7fffff) | 0x800000;;
213+
$m = ($e == 0) ? (($bits & 0x7fffff) << 1) : ($bits & 0x7fffff) | 0x800000;
214214
return $s * $m * pow(2, $e - 150);
215215
}
216216
}

0 commit comments

Comments
 (0)