@Test public void testConvertDoubleNan() { double nan = Double.NaN; ConvertDistances converter = new ConvertDistances(ConvertDistances.Distance.MILE, ConvertDistances.Distance.KILOMETER); Assert.assertEquals(nan, converter.convert(nan), 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);  }