[numbers-fraction] of() methods for BigFraction - take BigInteger only, or include long and int?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[numbers-fraction] of() methods for BigFraction - take BigInteger only, or include long and int?

Eric Barnhill
Almost done with Fraction here.

Fraction() operates with int inputs only, due to the mathematical
limitations of the fast algorithm, so of() methods only need to handle int
inputs.

But what about BigFraction()? Right now the of() methods handle BigIngeters
only. Do we want to expand this so a BigFraction of() method can handle any
combination of BigInteger, long, and int? That would be quite a few
constructors but that's life with hard typing. Or should we document that
the user should wrap arguments to a BigFraction of() call in the BigInteger
class? I suppose I lean toward the latter.

Once I resolve this issue, I think I'll be able to run a style check and
submit the code for anyone interested to review.