commons-math

Why does the BigFraction class in the Apache-Commons-Math library return incorrect division results?

In the spirit of using existing, tested and stable libraries of code, I started using the Apache-Commons-Math library and its BigFraction class to perform some rational calculations for an Android app I'm writing called RationalCalc. It works great for every task that I have thrown at it, except for one nagging problem. When dividing c...

Get the integral part of a BigFraction, as a BigInteger

What is an easy way to get the integral part of a BigFraction as a BigInteger? Basically I want the same result that the intValue and longValue methods return but with arbitrary precision. I also want to avoid rounding so indirect conversion via a BigDecimal is not suitable. ...