/** * Return the long value this BitChromosome represents. * * @return long value this BitChromosome represents. */ @Override public int intValue() { return (int)longValue(); }
/** * Return the float value this BitChromosome represents. * * @return float value this BitChromosome represents. */ @Override public float floatValue() { return (float)longValue(); }
/** * Return the double value this BitChromosome represents. * * @return double value this BitChromosome represents. */ @Override public double doubleValue() { return longValue(); }
@Test public void numValue() { BitChromosome c1 = BitChromosome.of(10); int value = c1.intValue(); assertEquals((short)value, c1.shortValue()); assertEquals(value, c1.longValue()); assertEquals((float)value, c1.floatValue()); assertEquals((double)value, c1.doubleValue()); }