@Test
    public void testLength() {
        /*
         * avoid underflow when lengthSquared is < Float.MIN_VALUE
         */
        assertEquals(1.5621336e-36f,
                new Vector3f(1.88079e-37f, 0.0f, 1.55077e-36f).length(), 0f);

        assertEquals(Float.NaN, new Vector3f(Float.NaN, 0.0f, 1.55077e-36f).length(), 0.0f);
        assertEquals(Float.POSITIVE_INFINITY, new Vector3f(Float.POSITIVE_INFINITY, 0.0f, 1.0f).length(), 0.0f);

        assertEquals(4.0124f, new Vector3f(1.9f, 3.2f, 1.5f).length(), 0.001f);
        /*
         * avoid overflow when lengthSquared > Float.MAX_VALUE
         */
        assertEquals(2.5499999e37f,
                new Vector3f(1.8e37f, 1.8e37f, 1.5e36f).length(), 0.0f);
    }
Verify that distance() doesn't always overflow when distanceSquared >
Float.MAX_VALUE .
jme3-core/src/test/java/com/jme3/math/Vector3fTest.java