[ https://issues.apache.org/jira/browse/IMAGING-228?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16855177#comment-16855177 ]
Gilles commented on IMAGING-228: -------------------------------- {quote}For maintainability - for now. {quote} I just wanted to point out that the Math method takes 2 {{double}} as arguments. IMO, it is easier to keep track of the specific needs with private methods like "cube" and "square". But I won't dispute more how you want to manage the improvement of that codebase. {quote}commons-math had some sort of optimized math methods {quote} Yes. Some of the methods in {{FastMath}} were faster than their counterpart in the JDK, but some were slower. There is an old JIRA about this. Also, several Java releases have happened since then, and I'd be surprised if the JVM hadn't caught up (this could be checked with JMH). The main advantage of {{FastMath}} was the improved accuracy (but, again, this advantage may have dwindled in more recent JVMs). Unless there is some follow-up on the findings reported in the JIRA issue, I wouldn't recommend coding against {{FastMath}} (it's the reason it is not part on the new math-related components). > Remove private method PhotometricInterpreterLogLuv#cube by Math.pow > ------------------------------------------------------------------- > > Key: IMAGING-228 > URL: https://issues.apache.org/jira/browse/IMAGING-228 > Project: Commons Imaging > Issue Type: Improvement > Reporter: Bruno P. Kinoshita > Assignee: Bruno P. Kinoshita > Priority: Minor > Fix For: 1.0-alpha2 > > Time Spent: 10m > Remaining Estimate: 0h > > We have a private method in PhotometricInterpreterLogLuv, that calculates the > cube of a number N doing N * N * N. That can be replaced by Math.pow(N, 3). > Will add unit tests and some javadocs around photometric interpreters, > logluv, cei, lab, color spaces, ceixyz-ceilab, etc, as well. -- This message was sent by Atlassian JIRA (v7.6.3#76005)