@Test public void testConvertMinValue() { double min = Double.MIN_VALUE; ConvertDistances converter0 = new ConvertDistances(ConvertDistances.Distance.MILLIMETER, ConvertDistances.Distance.LIGHT_YEAR); Assert.assertEquals(0.0, converter0.convert(min), delta); ConvertDistances converter1 = new ConvertDistances(ConvertDistances.Distance.LIGHT_YEAR, ConvertDistances.Distance.MILLIMETER); Assert.assertEquals(0.0, converter1.convert(min), delta); }
public double convert(double value) { if (Double.isNaN(value)) { return value; } if (from.equals(to)) { return value; } BigDecimal result = new BigDecimal(String.valueOf(value)).multiply(multiplier); return result.doubleValue(); }
ConvertDistances { public double convert(double value) { if (Double.isNaN(value)) { return value; } if (from.equals(to)) { return value; } BigDecimal result = new BigDecimal(String.valueOf(value)).multiply(multiplier); return result.doubleValue(); } }
ConvertDistances { public double convert(double value) { if (Double.isNaN(value)) { return value; } if (from.equals(to)) { return value; } BigDecimal result = new BigDecimal(String.valueOf(value)).multiply(multiplier); return result.doubleValue(); } ConvertDistances(); @Nullable  ConvertDistances(Distance from, Distance to); }
ConvertDistances { public double convert(double value) { if (Double.isNaN(value)) { return value; } if (from.equals(to)) { return value; } BigDecimal result = new BigDecimal(String.valueOf(value)).multiply(multiplier); return result.doubleValue(); } ConvertDistances(); @Nullable  ConvertDistances(Distance from, Distance to); double convert(double value); }
ConvertDistances { public double convert(double value) { if (Double.isNaN(value)) { return value; } if (from.equals(to)) { return value; } BigDecimal result = new BigDecimal(String.valueOf(value)).multiply(multiplier); return result.doubleValue(); } ConvertDistances(); @Nullable  ConvertDistances(Distance from, Distance to); double convert(double value);  }