public function pNorm(float $p = 3.)
    {
        if ($p <= 0.) {
            throw new InvalidArgumentException('P must be greater'
                . " than 0, $p given.");
        }

        return $this->abs()->powScalar($p)->sum() ** (1. / $p);
    }
public function pNorm(float $p = 3.)
    {
        if ($p <= 0.) {
            throw new InvalidArgumentException('P must be greater'
                . " than 0, $p given.");
        }

        return $this->abs()->powScalar($p)->sum() ** (1. / $p);
    }
public function pNorm ( float $ p = 3. ) { if ( $ p <= 0. ) { throw new InvalidArgumentException ( 'P must be greater' . " than 0, $p given." ) ; } return $ this -> abs ( ) -> powScalar ( $ p ) -> sum ( ) ** ( 1. / $ p ) ; }
Calculate the p-norm of the vector.

@param float $p
@throws \InvalidArgumentException
@return int|float
Calculate the p - norm of the vector .