Is there a commonly used rational numbers library in Java?

前端 未结 5 978
日久生厌
日久生厌 2020-11-27 05:55

I\'m looking for a Java library which represents fractions (rational numbers). For example, if I want to store the fraction 1/3 then it will not be saved as

5条回答
  •  甜味超标
    2020-11-27 06:13

    I'm not sure how commonly used it is, but the apfloat packages (Java and C++) contain a class for rational arithmetic.

提交回复
热议问题