@FunctionalInterface public interface FloatPredicate2 extends Predicate2<java.lang.Float,java.lang.Float>
Modifier and Type | Field and Description |
---|---|
static FloatPredicate2 |
EQUAL_EVEN_NAN
Predicate which checks whether two float values are equal
which handles NaN values in a way that
Float.NaN == Float.NaN
is true . |
static FloatPredicate2 |
EQUAL_STANDARD
Predicate which checks whether two float values are equal
which handles NaN as defined by IEEE 745 so that
Float.NaN == Float.NaN
is false , i.e. |
ALWAYS_FALSE, ALWAYS_TRUE
Modifier and Type | Method and Description |
---|---|
default boolean |
test(java.lang.Float value1,
java.lang.Float value2)
Default implementation.
|
default boolean |
test(FloatPair pair)
Test a float pair by expanding its elements.
|
boolean |
testFloats(float value1,
float value2)
Test the given value.
|
after1, after2, after3, after5, after6, after7, after8, after9, alwaysFalse, alwaysTrue, and, and, apply, areIdentical, from, isEqual, negate, or, or, partial1, partial2, partialLeft, partialRight, reverseOrder, test, xor, xor
@NotNull static final FloatPredicate2 EQUAL_EVEN_NAN
Float.NaN == Float.NaN
is true
. It also handles -0.0 == 0.0
in a better way
than standard Java using Float.compare(float, float)
which considers
them different, although above equality is true
.EQUAL_STANDARD
,
Primitives.areEqual(float, float)
@NotNull static final FloatPredicate2 EQUAL_STANDARD
Float.NaN == Float.NaN
is false
, i.e. NaN is different from any other value including
itself.EQUAL_EVEN_NAN
boolean testFloats(float value1, float value2)
value1
- first value to testvalue2
- second value to testtrue
if the values match the predicate, false
otherwisedefault boolean test(java.lang.Float value1, java.lang.Float value2)
testFloats(float, float)
.
Double.NaN
will be used instead of null
.test
in interface java.util.function.BiPredicate<java.lang.Float,java.lang.Float>
value1
- first valuevalue2
- second valuetrue
if the values match the predicate, false
otherwise