Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Question 1 /** * Returns a^b, as the standard mathematical exponentiation
- // function */
- public BigDecimal mathExp(BigDecimal a, BigDecimal b){
- return a.pow(b.intValue());
- }
- @Test
- public void test() {
- Assert.assertEquals(new BigDecimal(100),mathExp(new BigDecimal(10),new BigDecimal(2)));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement