Sass-Math icon indicating copy to clipboard operation
Sass-Math copied to clipboard

number to the zero power() is one

Open demrks opened this issue 10 years ago • 2 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

demrks avatar Jul 25 '14 14:07 demrks

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

danielcreid avatar Oct 17 '14 15:10 danielcreid

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

mikhaelr avatar Jul 30 '15 20:07 mikhaelr