(latLongAlt, time);
System.out.println(latLongAltTime);
> [34.34 °, 23.559999999999999 °, 609.6 m, 1.18092879739E9 s]
[/code]
Number types (org.jscience.mathematics.number)
[code]
Real two = Real.valueOf(2); // 2.0000..00
Real three = Real.valueOf(3);
Real.setExactPrecision(100); // Assumes 100 exact digits for exact numbers.
System.out.println("2/3 = " + two.divide(three));
Real sqrt2 = two.sqrt();
System.out.println("sqrt(2) = " + sqrt2);
System.out.println("Precision = " + sqrt2.getPrecision() + " digits.");
> 2/3 = 6.66666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666667E-1
> sqrt(2) = 1.4142135623730950488016887242096980785696718753769
> Precision = 50 digits.
LargeInteger dividend = LargeInteger.valueOf("3133861182986538201");
LargeInteger divisor = LargeInteger.valueOf("25147325102501733369");
Rational rational = Rational.valueOf(dividend, divisor);
System.out.println("rational = " + rational);
> rational = 41/329
ModuloInteger m = ModuloInteger.valueOf("233424242346");
LocalContext.enter(); // Avoids impacting others threads when setting the modulo.
try {
ModuloInteger.setModulus(LargeInteger.valueOf("31225208137"));
ModuloInteger inv = m.inverse();
System.out.println("inverse modulo = " + inv);
ModuloInteger one = inv.times(m);
System.out.println("verification: one = " + one);
} finally {
LocalContext.exit();
}
> inverse modulo = 14099421625
> verification: one = 1
[/code]
Additional examples can be find in the packages descriptions...
Benchmark data available here
License:
Permission to use, copy, modify, and distribute this software is freely granted,
provided that copyright notices are preserved.
The full license text can be found here).
Note: The JScience binary (.jar) includes the latest
Javolution classes for the J2SE 1.5+ runtime.