Here you can find the source of floatEquals(float a, float b)
Parameter | Description |
---|---|
a | single-precision value |
b | single-precision value |
public static boolean floatEquals(float a, float b)
//package com.java2s; // Licensed under the MIT license. See LICENSE file in the project root for full license information. public class Main { /**/*from w w w .ja va2s .co m*/ * Implements the semantics of {@link Float#equals(Object)} for two * primitive floats. * * @param a single-precision value * @param b single-precision value * @return true if equal, false if not */ public static boolean floatEquals(float a, float b) { return Float.floatToIntBits(a) == Float.floatToIntBits(b); } }