use of javax.measure.UnitConverter in project indriya by unitsofmeasurement.
the class PrefixTest method testMebi.
@Test
public void testMebi() {
final UnitConverter expected = new RationalConverter(8, 15625);
final UnitConverter actual = MEBI(METRE).getConverterTo(MEGA(METRE));
assertEquals(expected, actual);
}
use of javax.measure.UnitConverter in project indriya by unitsofmeasurement.
the class PrefixTest method testTebi.
@Test
public void testTebi() {
final UnitConverter expected = new RationalConverter(1, 3906250000l);
final UnitConverter actual = TEBI(LITRE).getConverterTo(TERA(LITRE));
assertEquals(expected, actual);
}
use of javax.measure.UnitConverter in project indriya by unitsofmeasurement.
the class PrefixTest method testGibi.
@Test
public void testGibi() {
final UnitConverter expected = new RationalConverter(2, 5859375);
final UnitConverter actual = GIBI(METRE).getConverterTo(GIGA(METRE));
assertEquals(expected, actual);
}
use of javax.measure.UnitConverter in project indriya by unitsofmeasurement.
the class PrefixTest method testPebi.
@Test
public void testPebi() {
final UnitConverter expected = new RationalConverter(1, 4882812500000L);
final UnitConverter actual = PEBI(LITRE).getConverterTo(PETA(LITRE));
assertEquals(expected, actual);
}
use of javax.measure.UnitConverter in project uom-se by unitsofmeasurement.
the class PrefixTest method testNestedOperationsShouldBeSame.
@Test
@Ignore("This is research for https://github.com/unitsofmeasurement/uom-se/issues/164")
public void testNestedOperationsShouldBeSame() {
Unit<Mass> m1 = MICRO(GRAM);
Unit<Mass> m2 = GRAM.divide(1000).divide(1000);
UnitConverter c1 = m1.getConverterTo(m2);
List steps1 = c1.getConversionSteps();
UnitConverter c2 = m2.getConverterTo(m1);
List steps2 = c2.getConversionSteps();
assertEquals(c1, c2);
assertEquals(m1, m2);
}
Aggregations