@Test
public void testDoublePrecision() throws Exception {

    TypeInformation[] types = new TypeInformation[]{Types.DOUBLE};
    CsvFormatter formatter = new CsvFormatter(types, ",", '"');
    CsvParser parser = new CsvParser(types, ",", '"');
    Double[] values = new Double[]{Double.MAX_VALUE, Double.MIN_VALUE, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY,
        new Random().nextDouble()};
    for (Double v : values) {
        String text = formatter.format(Row.of(v));
        Row parsed = parser.parse(text).f1;
        Double p = (Double) parsed.getField(0);
        Assert.assertEquals(v, p, 0.);
    }
}