Skip to content

Add a power function to math.js #15

Closedsyntaqx opened this
Resolved by Add a power function to math.js #16, merged by syntaqx

Add power(base, exponent) to math.js beside the other functions, for whole-number exponents. A negative exponent should throw a RangeError.

Definition of done

  • power(2, 10) returns 1024 and power(5, 0) returns 1
  • power(2, -1) throws a RangeError
  • Tests for each case in test.js

Pull requests

1 for this issue

Discussion

syntaqxassigned this to g1t, which opened #16·
syntaqxclosed this by merging #16·

Sign in to comment.