[
https://issues.apache.org/jira/browse/LANG-1601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17183777#comment-17183777
]
Jin Xu commented on LANG-1601:
------------------------------
[~erans]
Hi.
I checked commons-number's class Fraction's function pow.
It looks good, and seems can be ported to commons-lang after several changes.
But it also differs slightly in some ways.
1. if exponent == 1, then the pow in commons-lang MUST return the original
Fraction Object itself.
2. if exponent == -1, then the pow in commons-lang MUST return the reversed
Fraction Object, but cannot do trim.
for example, (6/10 , -1) MUST return 10/6 , but MUST NOT return 5/3
3. must trim otherwise before do the pow.
However, it really helps, as I get some new ideas about how do a deeper refine.
will commit soon.
> refine performance of Fraction.pow
> ----------------------------------
>
> Key: LANG-1601
> URL: https://issues.apache.org/jira/browse/LANG-1601
> Project: Commons Lang
> Issue Type: Improvement
> Components: lang.math.*
> Reporter: Jin Xu
> Priority: Minor
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> https://github.com/apache/commons-lang/pull/611
--
This message was sent by Atlassian Jira
(v8.3.4#803005)