PowTests.java revision 809
70e5a7403f0e0a3bd292b8287c5fed5772c15270Automatic Updater * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved.
499b34cea04a46823d003d4c0520c8b03e8513cbBrian Wellington * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ec5347e2c775f027573ce5648b910361aa926c01Automatic Updater * This code is free software; you can redistribute it and/or modify it
d0be1e954bd4674fc27f2616c72adb37cf3525a2David Lawrence * under the terms of the GNU General Public License version 2 only, as
d0be1e954bd4674fc27f2616c72adb37cf3525a2David Lawrence * published by the Free Software Foundation.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * This code is distributed in the hope that it will be useful, but WITHOUT
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * version 2 for more details (a copy is included in the LICENSE file that
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * accompanied this code).
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * You should have received a copy of the GNU General Public License version
d0be1e954bd4674fc27f2616c72adb37cf3525a2David Lawrence * 2 along with this work; if not, write to the Free Software Foundation,
d0be1e954bd4674fc27f2616c72adb37cf3525a2David Lawrence * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
821644d49b73b49f2abc5463bc53a3132f612478Mark Andrews * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
821644d49b73b49f2abc5463bc53a3132f612478Mark Andrews * CA 95054 USA or visit www.sun.com if you need additional information or
9c3531d72aeaad6c5f01efe6a1c82023e1379e4dDavid Lawrence * have any questions.
dec3e76636390eb25db44659bdd7b3ff8b0468cbMichael Sawyer * @bug 4916097
dec3e76636390eb25db44659bdd7b3ff8b0468cbMichael Sawyer * @summary Some exponent over/undeflow tests for the pow method
dec3e76636390eb25db44659bdd7b3ff8b0468cbMichael Sawyer * @author Joseph D. Darcy
5a77e9620a0b2f7417469c98be374de49d0eccc6Andreas Gustafsson * @compile -source 1.5 PowTests.java
dec3e76636390eb25db44659bdd7b3ff8b0468cbMichael Sawyer * @run main PowTests
{BigDecimal.valueOf(0, Integer.MAX_VALUE), new BigDecimal(1), BigDecimal.valueOf(0, Integer.MAX_VALUE)},
{BigDecimal.valueOf(0, Integer.MAX_VALUE), new BigDecimal(2), BigDecimal.valueOf(0, Integer.MAX_VALUE)},
{BigDecimal.valueOf(0, Integer.MAX_VALUE), new BigDecimal(999999999), BigDecimal.valueOf(0, Integer.MAX_VALUE)},
{BigDecimal.valueOf(0, Integer.MIN_VALUE), new BigDecimal(1), BigDecimal.valueOf(0, Integer.MIN_VALUE)},
{BigDecimal.valueOf(0, Integer.MIN_VALUE), new BigDecimal(2), BigDecimal.valueOf(0, Integer.MIN_VALUE)},
{BigDecimal.valueOf(0, Integer.MIN_VALUE), new BigDecimal(999999999), BigDecimal.valueOf(0, Integer.MIN_VALUE)},
{BigDecimal.valueOf(1, Integer.MAX_VALUE), new BigDecimal(1), BigDecimal.valueOf(1, Integer.MAX_VALUE)},
{BigDecimal.valueOf(1, Integer.MIN_VALUE), new BigDecimal(1), BigDecimal.valueOf(1, Integer.MIN_VALUE)},
failures++;
} catch (ArithmeticException e) {
failures++;
return failures;