diff --git a/math.scss b/math.scss index 5dd2a43..db7a261 100644 --- a/math.scss +++ b/math.scss @@ -1,16 +1,16 @@ -@function power ($x, $n) { +@function power($base, $exponent) { $ret: 1; - - @if $n >= 0 { - @for $i from 1 through $n { - $ret: $ret * $x; - } - } @else { - @for $i from $n to 0 { - $ret: $ret / $x; + + @if $exponent > 0 { + @for $i from 1 through $exponent { + $ret: $ret * $base; + } + } @else if $exponent < 0 { + @for $i from $exponent to 0 { + $ret: $ret / $base; } } - + @return $ret; }