NUMBERS-150: Fix Fraction.pow and BigFraction.pow

Modified to:

- correctly handle Integer.MIN_VALUE as the argument.
- throw an ArithmeticException when zero is raised to a negative power.

Squashed commit of the following:

commit 0fd1da5bdb92bf31b7dd4ec3981924c5f68dbef4
Author: XenoAmess <xenoamess@gmail.com>
Date:   Wed Aug 26 04:36:46 2020 +0800

    fix checkstyles

commit 4c2aa76d0f4425e55eccd23e4a40a19eb9834a31
Author: XenoAmess <xenoamess@gmail.com>
Date:   Wed Aug 26 04:34:54 2020 +0800

    apply suggestions

commit 0fc3a52c4d3789b18795392223e6add522843a0a
Author: XenoAmess <xenoamess@gmail.com>
Date:   Wed Aug 26 04:27:42 2020 +0800

    apply suggestions

commit 1481998f24c49bf8f20123703037a6fbefe6b9af
Author: XenoAmess <xenoamess@gmail.com>
Date:   Wed Aug 26 04:24:58 2020 +0800

    apply suggestions

commit 44678423889201f2c60ac024e132593336033bc9
Author: XenoAmess <xenoamess@gmail.com>
Date:   Wed Aug 26 03:28:58 2020 +0800

    fix checkstyles

commit 708414cdb8046c442360469f294b77729f5d345c
Author: XenoAmess <xenoamess@gmail.com>
Date:   Wed Aug 26 03:27:43 2020 +0800

    change as suggested

commit 5b9c91aaae49f7b2d8d331b2d8947bd1b684151e
Author: XenoAmess <xenoamess@gmail.com>
Date:   Wed Aug 26 03:24:56 2020 +0800

    change as suggested

commit 12142b608c3776e498fd17d66d51f4a7bc48e8f8
Author: XenoAmess <xenoamess@gmail.com>
Date:   Wed Aug 26 03:23:57 2020 +0800

    change as suggested

commit 3f10f12e3f9bb79edb835682cefeeea5ccf6a7ca
Author: XenoAmess <xenoamess@gmail.com>
Date:   Wed Aug 26 03:22:13 2020 +0800

    change as suggested

commit d01b5b8f509c5c9641798d57e4de1434cbac9688
Author: XenoAmess <xenoamess@gmail.com>
Date:   Wed Aug 26 03:20:50 2020 +0800

    change as suggested

commit 6f23df0d9fe789faff07406482108810b0eaf8b4
Author: XenoAmess <xenoamess@gmail.com>
Date:   Wed Aug 26 03:16:33 2020 +0800

    change as suggested

commit 3646e00ce9c17a81ca3a64ffe103974c44b33995
Author: XenoAmess <xenoamess@gmail.com>
Date:   Wed Aug 26 03:15:10 2020 +0800

    change as suggested

commit 3d4bc49f704ee0784ccdc96ab61edeb3720dbff3
Author: XenoAmess <xenoamess@gmail.com>
Date:   Wed Aug 26 03:13:29 2020 +0800

    change as suggested

commit 267df9448e14d28451e9d2ad88783f4bc32b635b
Author: XenoAmess <xenoamess@gmail.com>
Date:   Wed Aug 26 03:12:04 2020 +0800

    change as suggested

commit ba0d39ba532f36e62417b277641932fe46f6af23
Author: XenoAmess <xenoamess@gmail.com>
Date:   Tue Aug 25 21:26:27 2020 +0800

    [NUMBERS-150] fix bug in Fraction.pow and BigFraction.pow
5 files changed
tree: 88dde081d60d7b128e80857735ca2f2610f811f2
  1. commons-numbers-angle/
  2. commons-numbers-arrays/
  3. commons-numbers-combinatorics/
  4. commons-numbers-complex/
  5. commons-numbers-complex-streams/
  6. commons-numbers-core/
  7. commons-numbers-examples/
  8. commons-numbers-field/
  9. commons-numbers-fraction/
  10. commons-numbers-gamma/
  11. commons-numbers-primes/
  12. commons-numbers-quaternion/
  13. commons-numbers-rootfinder/
  14. dist-archive/
  15. doc/
  16. src/
  17. .gitattributes
  18. .gitignore
  19. .travis.yml
  20. CONTRIBUTING.md
  21. LICENSE
  22. NOTICE
  23. pom.xml
  24. README.md
  25. RELEASE-NOTES.txt
README.md

Apache Commons Numbers

Build Status Coverage Status Quality Gate Status Maven Central Code Quality:Java

The Apache Commons Numbers project provides number types and utilities.

Documentation

More information can be found on the Apache Commons Numbers homepage. The Javadoc for each of the modules can be browsed:

Questions related to the usage of Apache Commons Numbers should be posted to the user mailing list.

Where can I get the latest release?

You can download source and binaries from our download page.

Alternatively you can pull it from the central Maven repositories:

<dependency>
  <groupId>org.apache.commons</groupId>
  <artifactId>commons-numbers-parent</artifactId>
  <version>1.0-beta1</version>
</dependency>

Contributing

We accept Pull Requests via GitHub. The developer mailing list is the main channel of communication for contributors. There are some guidelines which will make applying PRs easier for us:

  • No tabs! Please use spaces for indentation.
  • Respect the code style.
  • Create minimal diffs - disable on save actions like reformat source code or organize imports. If you feel the source code should be reformatted create a separate PR for this change.
  • Provide JUnit tests for your changes and make sure your changes don't break any existing tests by running mvn clean test.

If you plan to contribute on a regular basis, please consider filing a contributor license agreement. You can learn more about contributing via GitHub in our contribution guidelines.

License

This code is under the Apache Licence v2.

See the NOTICE file for required notices and attributions.

Donations

You like Apache Commons Numbers? Then donate back to the ASF to support the development.

Additional Resources