Wednesday, June 16, 2004

Exercise[12]

00:11 | 00:12 | 00:13
  1. Study A Powerful Trick
  2. Study pow (Java or JavaScript?). Make sure you have actually called the Java or JavaScript versions of pow with various argument values. Try to find argument values that cause pow to return the wrong answer.
  3. If you were able to find any argument values that cause pow to return the wrong answer, try to improve the implementation of pow. If you're not sure how to implement an improvement in Java or JavaScript, try to at least explain (using English) what you would do to improve the code.
  4. Read Comment carefully and find the error. (Comment: It's not too hard to find!)