code: private static int compare(float f1, float f2) {
          if (f1 < f2)
              return -1;           // Neither val is NaN, thisVal is smaller
          if (f1 > f2)
              return 1;            // Neither val is NaN, thisVal is larger
  
          // Cannot use floatToRawIntBits because of possibility of NaNs.
          int thisBits    = Float.floatToIntBits(f1);
          int anotherBits = Float.floatToIntBits(f2);
  
          return (thisBits == anotherBits ?  0 : // Values are equal
                  (thisBits < anotherBits ? -1 : // (-0.0, 0.0) or (!NaN, NaN)
                   1));                          // (0.0, -0.0) or (NaN, !NaN)
      }
docs: /*
  From the JRE's Float.compare().