Eris\Quantifier\Size::triangleNumber PHP Method

triangleNumber() private static method

Returns the number of dots needed to compose a triangle with n dots on a side. E.G.: when n=3 the function evaluates to 6 . . . . . .
private static triangleNumber ( $n )
    private static function triangleNumber($n)
    {
        if ($n === 0) {
            return 0;
        }
        return $n * ($n + 1) / 2;
    }