[
https://issues.apache.org/jira/browse/NUMBERS-150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17184653#comment-17184653
]
Alex Herbert commented on NUMBERS-150:
--------------------------------------
By design Fraction 0 / 1 is zero when raised to any non-zero power and 1 / 1
when raised to the power 0.
Technically zero to the power of 0 is undefined (i.e. throw an exception). But
in the interest of usability it can be represented as 1 so that computations
can be performed for all numbers.
There should be tests for this in the current test suite. Perhaps this is best
addressed by more comments in the Fraction class on expected behaviour.
This may have already been debated on the ML. Perhaps [~erans] can recall the
design choice. The behaviour is different from Fraction in commons lang.
> Fraction.pow to correctly handle Integer.MIN_VALUE as the argument
> ------------------------------------------------------------------
>
> Key: NUMBERS-150
> URL: https://issues.apache.org/jira/browse/NUMBERS-150
> Project: Commons Numbers
> Issue Type: Bug
> Components: fraction
> Reporter: Jin Xu
> Priority: Major
> Time Spent: 1h 20m
> Remaining Estimate: 0h
>
> a bug was discovered by [NUMBERS-149].
> here is the fix pr.
> https://github.com/apache/commons-numbers/pull/83
--
This message was sent by Atlassian Jira
(v8.3.4#803005)