Answer 6: Floating point test

    public void testDoubleValue() {
        Fraction a = new Fraction(5, 3);
        assertEquals(5.0/3.0, a.doubleValue(), 0.000000001);
    }

Previous | Next | Top | Cafe con Leche

Copyright 2005-2007 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified November 11, 2005