JSciencev4.3.1的
Real类似乎等效,
BigDecimal并且可能会对您有所帮助。用法示例:
// The Square Root of Two, to 30 digits// According to "The Square Root of Two, to 5 million digits."// Source: http://www.gutenberg.org/files/129/129.txtSystem.out.println("1.41421356237309504880168872420");// Using JScience with 50 digits precisionReal.setExactPrecision(50);System.out.println(Real.valueOf(2).sqrt());// Using default java implementationSystem.out.println(Math.sqrt(2));> 1.41421356237309504880168872420> 1.414213562373095048801689> 1.4142135623730951编辑 :更新了代码和链接以反映当时的当前版本(v4.3.1)。基于@ile和@Tomasz评论,谢谢。



