number to the zero power() is one
demrks opened this issue · comments
demrks commented
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
Daniel Reid commented
Rindone Mikhaël commented
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