[
https://issues.apache.org/jira/browse/MATH-754?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13217136#comment-13217136
]
Gilles commented on MATH-754:
-----------------------------
bq. [...] in commons-math 2.2, Fraction is declared final. [...]
I don't see this in the code!
bq. [...] I do have one counter argument. [...]
I'm not sure that it's really the same kind of limitation, but I agree that
where to draw the line is also a matter of taste...
You should then start a discussion on the "dev" ML.
bq. Maybe there should be a separate class that is responsible for converting
doubles to Fractions to keep the Fraction class clean?
That would be nice. I'm pretty sure that other people will also be interested
in this approach. I think that the "factory" pattern will be quite appropriate
for implementing this functionality.
> Additional Fraction Constructor
> -------------------------------
>
> Key: MATH-754
> URL: https://issues.apache.org/jira/browse/MATH-754
> Project: Commons Math
> Issue Type: Improvement
> Affects Versions: 3.0
> Environment: All
> Reporter: Travis Hanna
> Priority: Minor
> Labels: features, newbie, patch
> Fix For: 3.0
>
> Attachments: math.patch
>
>
> I'm writing some code which outputs fractional measurements meant for human
> consumption. I need a constructor for Fraction which allows you to restrict
> the denominators to a finite set. This is necessary due to the fact that
> real-world tools are only available with certain fractions. For example, it's
> next to impossible to find a ruler with 1/7 inch marked :).
> I'm attaching a patch which implements the functionality. I've attempted to
> mimic the style of the existing code as much as possible. One caveat: I don't
> speak French so the french error message is a computer-generated translation
> and probably very poor.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira