Use of Erfc function: commons.apache.org library

2019-06-09 18:17发布

问题:

My problem is simple: I would like to use the error function Erfc(double) in Java with Eclipse but I do not want to implement it (because it is complicated).

So, I have found this:

http://commons.apache.org/proper/commons-math/apidocs/org/apache/commons/math3/special/Erf.html

That does exactly what I want. The problem is that I can not use it. As it is not from "docs.oracle.com", I can not just import it. But unfortunately, I can not include the library and use it neither because what I download from :

http://commons.apache.org/proper/commons-math/download_math.cgi

is not a .jar

Does someone know how to "install - use" it?

I use Ubuntu 12.04 on a Intel® Core™ i7-3610QM CPU @ 2.30GHz × 8 and my IDE is ecplipse.

回答1:

Ok, this was a stupid question! So I have found the answer by myself.

I just needed to download the binary files and add it as a .jar. Then it works as a classical library.

To use it, I must

import org.apache.commons.math3.*;