adambom / Sass-Math

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

number to the zero power() is one

demrks opened this issue · comments

In math any number to the zero power is one, so

power(2, 0);

should return "1", but it returns return "4"

http://www.homeschoolmath.net/teaching/zero-exponent-proof.php

FYI -- I submitted a pull request about a week ago that resolves this issue.
@adambom @demrks

I'm late but you just have to replace this statement :
@if $n >= 0

With this one:
@if $n > 0

By doing that, when $i == 0 the loop looks like this :
@for 1 from 0 to 0
This means that the loop stop right before 0... So the loop don't start and the function return 1