Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

number to the zero power() is one #3

Open
demrks opened this issue Jul 25, 2014 · 2 comments
Open

number to the zero power() is one #3

demrks opened this issue Jul 25, 2014 · 2 comments

Comments

@demrks
Copy link

demrks commented Jul 25, 2014

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

@danielcreid
Copy link

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

@mikhaelr
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants