use of net.imglib2.type.numeric.integer.LongType in project imagej-ops by imagej.
the class UnaryRealTypeMathTest method testCoth.
@Test
public void testCoth() {
final LongType in = new LongType(1234567890);
final DoubleType out = new DoubleType();
ops.run(Coth.class, out, in);
assertEquals(out.get(), 1 / Math.tanh(1234567890), 0.0);
}
use of net.imglib2.type.numeric.integer.LongType in project imagej-ops by imagej.
the class UnaryRealTypeMathTest method testSqr.
@Test
public void testSqr() {
final LongType in = new LongType(94906267L);
final LongType out = (LongType) ops.run(Sqr.class, in.createVariable(), in);
// NB: for any odd number greater than LARGE_NUM - 1, its double
// representation is not exact.
assertEquals(out.get(), 94906267L * 94906267L - 1);
}
use of net.imglib2.type.numeric.integer.LongType in project imagej-ops by imagej.
the class UnaryRealTypeMathTest method testCubeRoot.
@Test
public void testCubeRoot() {
final LongType in = new LongType(1234567890);
final DoubleType out = new DoubleType();
ops.run(CubeRoot.class, out, in);
assertEquals(out.get(), Math.cbrt(1234567890), 0.0);
}
use of net.imglib2.type.numeric.integer.LongType in project imagej-ops by imagej.
the class UnaryRealTypeMathTest method testSqrt.
@Test
public void testSqrt() {
final LongType in = new LongType(1234567890);
final DoubleType out = new DoubleType();
ops.run(Sqrt.class, out, in);
assertEquals(out.get(), Math.sqrt(1234567890), 0.0);
}
use of net.imglib2.type.numeric.integer.LongType in project imagej-ops by imagej.
the class UnaryRealTypeMathTest method testArcsinh.
@Test
public void testArcsinh() {
final LongType in = new LongType(1234567890);
final DoubleType out = new DoubleType();
ops.run(Arcsinh.class, out, in);
final double delta = Math.sqrt(1234567890.0 * 1234567890.0 + 1);
assertEquals(out.get(), Math.log(1234567890 + delta), 0.0);
}
Aggregations