Advertisement
jbjares

Untitled

Aug 15th, 2015
682
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. // Question 1 /** * Returns a^b, as the standard mathematical exponentiation
  2. // function */
  3. public BigDecimal mathExp(BigDecimal a, BigDecimal b){
  4. return a.pow(b.intValue());
  5. }
  6.  
  7. @Test
  8. public void test() {
  9. Assert.assertEquals(new BigDecimal(100),mathExp(new BigDecimal(10),new BigDecimal(2)));
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement