-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Recursion Test - Part 1 (Exponent) #55
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
Comments
Hey, @asalem1 glad you're enjoying the repo! I concede to your math. Since JS is known to struggle with math, I suspect I used Google or some other calculator and failed to include parens around the negative number. Note the difference: Would you like to make a PR with the fix? |
If @asalem1 doesn't mind, I can submit a PR with the fix! |
That'd be great, @ejk91 ! |
PR submitted! |
@mybrainishuge Sorry about that, not sure how I didn't see the notification. Happy to hear it all worked out! |
First off, I wanted to say thanks for setting this up, it's been a huge help in practicing recursion! I just wanted to point out a slight issue with one of the tests (lines 435-440) in Part I. A negative base with an even exponent will yield a positive number.
it('should accept negative integer for base', function() {
expect(exponent(-3,4)).to.equal(-81); //should be 81
expect(exponent(-12,5)).to.equal(-248832);
expect(exponent(-7,2)).to.equal(-49); //should be 49
expect(exponent(-7,4)).to.equal(-2401); //should be 2401
});
The text was updated successfully, but these errors were encountered: