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

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

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

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

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

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

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

@param float $massCharge
@param int $charge
@throws \InvalidArgumentException
@return float
gets the neutral mass for the specified mass - to - charge ratio and charge