I am overloading:
public static BigFraction ofInt(final BigInteger num) {
return new BigFraction(num, BigInteger.ONE);
}
public static BigFraction ofInt(BigInteger num, BigInteger den) {
return new BigFraction(num, den);
}
private BigFraction(BigInteger num, BigInteger den) {
Did my comment not give that impression?
On Thu, Dec 27, 2018 at 4:52 PM Gilles <[email protected]> wrote:
> On Thu, 27 Dec 2018 23:54:57 +0000, [email protected] wrote:
> > This is an automated email from the ASF dual-hosted git repository.
> >
> > ericbarnhill pushed a commit to branch fraction-dev
> > in repository https://gitbox.apache.org/repos/asf/commons-numbers.git
> >
> >
> > The following commit(s) were added to refs/heads/fraction-dev by this
> > push:
> > new ebb8e03 NUMBERS-91: Added ofInt() factory methods
>
> Why not rely on method overload? There is no need to duplicate
> part of the the method's signature in its name.
>
> Gilles
>
> > and made
> > BigInteger-based constructor private
> > ebb8e03 is described below
> >
> > commit ebb8e03f139b8cec84564b3e558fea39b71d2f24
> > Author: Eric Barnhill <[email protected]>
> > AuthorDate: Thu Dec 27 15:54:51 2018 -0800
> >
> > NUMBERS-91: Added ofInt() factory methods and made
> > BigInteger-based
> > constructor private
> > ---
> > .../commons/numbers/fraction/BigFraction.java | 68
> > +++++++---------------
> > 1 file changed, 20 insertions(+), 48 deletions(-)
> >
> > [...]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>