src/Core/ChargedMassTrait.php
public static function getMassCharge($mass, $charge)
    {
        if (! is_float($mass)) {
            throw new \InvalidArgumentException('Argument 1 must be of type float. Value is of type ' . gettype($mass));
        }

        if (! is_int($charge)) {
            throw new \InvalidArgumentException('Argument 2 must be of type int. Value is of type ' . gettype($charge));
        }

        if ($charge == 0) {
            return $mass;
        }

        return ($mass + ($charge * PhysicalConstants::PROTON_MASS)) / $charge;
    }
public static function getMassCharge($mass, $charge)
    {
        if (! is_float($mass)) {
            throw new \InvalidArgumentException('Argument 1 must be of type float. Value is of type ' . gettype($mass));
        }

        if (! is_int($charge)) {
            throw new \InvalidArgumentException('Argument 2 must be of type int. Value is of type ' . gettype($charge));
        }

        if ($charge == 0) {
            return $mass;
        }

        return ($mass + ($charge * PhysicalConstants::PROTON_MASS)) / $charge;
    }
public static function getMassCharge ( $ mass , $ charge ) { if ( ! is_float ( $ mass ) ) { throw new \ InvalidArgumentException ( 'Argument 1 must be of type float. Value is of type ' . gettype ( $ mass ) ) ; } if ( ! is_int ( $ charge ) ) { throw new \ InvalidArgumentException ( 'Argument 2 must be of type int. Value is of type ' . gettype ( $ charge ) ) ; } if ( $ charge == 0 ) { return $ mass ; } return ( $ mass + ( $ charge * PhysicalConstants :: PROTON_MASS ) ) / $ charge ; }
Gets the mass-to-charge value for the specified mass and charge

@param float $mass
@param int $charge
@return float
Gets the mass - to - charge value for the specified mass and charge