HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //opt/remi/php83/root/usr/share/tests/pecl/imagick/util/Float32Info.php
<?php

namespace HexFloat;

// Mirrored from https://github.com/Danack/HexFloat

class Float32Info
{
    //Sign bit: 1 bit
    private $sign;

    //Exponent: 11 bits
    private $exponent;

    //Mantissa precision: 53 bits (52 explicitly stored)
    private $mantissa;

    public function __construct(
        $sign,
        $exponent,
        $mantissa
    ) {
        // TODO - check lengths
        $this->sign = $sign;
        $this->exponent = $exponent;
        $this->mantissa = $mantissa;
    }

    public function getSign()
    {
        return $this->sign;
    }

    public function getExponent()
    {
        return $this->exponent;
    }

    public function getMantissa()
    {
        return $this->mantissa;
    }
}