/** * Verifies that the actual value is not equal to zero. * <p> * Although {@code 0.0 == -0.0} (primitives), {@code Double(-0.0)} is not zero as {@code Double.doubleToRawLongBits(0.0) == Double.doubleToRawLongBits(-0.0)} is false. * <p> * Example: * <pre><code class='java'> // assertions will pass * assertThat(3.142).isNotZero(); * assertThat(new Double(-0.0)).isNotZero(); * * // assertions will fail * assertThat(0.0).isNotZero(); * assertThat(new Double(0.0)).isNotZero(); * assertThat(-0.0).isNotZero();</code></pre> * * @return this assertion object. * @throws AssertionError if the actual value is {@code null}. * @throws AssertionError if the actual value is equal to zero. */ @Override public SELF isNotZero() { if (isPrimitive) assertIsPrimitiveNonZero(); else if (NEGATIVE_ZERO.equals(actual)) return myself; else doubles.assertIsNotZero(info, actual); return myself; }
/** * Verifies that the actual value is not equal to zero. * <p> * Although {@code 0.0 == -0.0} (primitives), {@code Double(-0.0)} is not zero as {@code Double.doubleToRawLongBits(0.0) == Double.doubleToRawLongBits(-0.0)} is false. * <p> * Example: * <pre><code class='java'> // assertions will pass * assertThat(3.142).isNotZero(); * assertThat(new Double(-0.0)).isNotZero(); * * // assertions will fail * assertThat(0.0).isNotZero(); * assertThat(new Double(0.0)).isNotZero(); * assertThat(-0.0).isNotZero();</code></pre> * * @return this assertion object. * @throws AssertionError if the actual value is {@code null}. * @throws AssertionError if the actual value is equal to zero. */ @Override public SELF isNotZero() { if (isPrimitive) assertIsPrimitiveNonZero(); else if (NEGATIVE_ZERO.equals(actual)) return myself; else doubles.assertIsNotZero(info, actual); return myself; }