diff --git a/lib/ASN1/Type/Primitive/Real.php b/lib/ASN1/Type/Primitive/Real.php index 3efd67f..5f3b24e 100644 --- a/lib/ASN1/Type/Primitive/Real.php +++ b/lib/ASN1/Type/Primitive/Real.php @@ -527,10 +527,14 @@ private static function _parse754Double(string $octets): array $n = gmp_import($octets, 1, GMP_MSW_FIRST | GMP_BIG_ENDIAN); // sign bit $neg = gmp_testbit($n, 63); + + // phpcs:disable PHPCompatibility.Miscellaneous.ValidIntegers.HexNumericStringFound // 11 bits of biased exponent $exp = (gmp_and($n, '0x7ff0000000000000') >> 52) + self::EXP_BIAS; // 52 bits of mantissa $man = gmp_and($n, '0xfffffffffffff'); + // phpcs:enable PHPCompatibility.Miscellaneous.ValidIntegers.HexNumericStringFound + // zero, ASN.1 doesn't differentiate -0 from +0 if (self::EXP_BIAS == $exp && 0 == $man) { return [gmp_init(0, 10), gmp_init(0, 10)];