public float getInternalFloat(ColumnInformation columnInfo) throws SQLException {
    if (lastValueWasNull()) {
      return 0;
    }

    long value;
    switch (columnInfo.getColumnType()) {
      case BIT:
        return parseBit();
      case TINYINT:
        value = getInternalTinyInt(columnInfo);
        break;
      case SMALLINT:
      case YEAR:
        value = getInternalSmallInt(columnInfo);
        break;
      case INTEGER:
      case MEDIUMINT:
        value = getInternalMediumInt(columnInfo);
        break;
      case BIGINT:
        value = ((buf[pos] & 0xff)
            + ((long) (buf[pos + 1] & 0xff) << 8)
            + ((long) (buf[pos + 2] & 0xff) << 16)
            + ((long) (buf[pos + 3] & 0xff) << 24)
            + ((long) (buf[pos + 4] & 0xff) << 32)
            + ((long) (buf[pos + 5] & 0xff) << 40)
            + ((long) (buf[pos + 6] & 0xff) << 48)
            + ((long) (buf[pos + 7] & 0xff) << 56));
        if (columnInfo.isSigned()) {
          return value;
        }
        BigInteger unsignedValue = new BigInteger(1, new byte[]{(byte) (value >> 56),
            (byte) (value >> 48), (byte) (value >> 40), (byte) (value >> 32),
            (byte) (value >> 24), (byte) (value >> 16), (byte) (value >> 8),
            (byte) value});
        return unsignedValue.floatValue();
      case FLOAT:
        int valueFloat = ((buf[pos] & 0xff)
            + ((buf[pos + 1] & 0xff) << 8)
            + ((buf[pos + 2] & 0xff) << 16)
            + ((buf[pos + 3] & 0xff) << 24));
        return Float.intBitsToFloat(valueFloat);
      case DOUBLE:
        return (float) getInternalDouble(columnInfo);
      case DECIMAL:
      case VARSTRING:
      case VARCHAR:
      case STRING:
      case OLDDECIMAL:
        try {
          return Float.valueOf(new String(buf, pos, length, StandardCharsets.UTF_8));
        } catch (NumberFormatException nfe) {
          SQLException sqlException = new SQLException(
              "Incorrect format for getFloat for data field with type "
                  + columnInfo.getColumnType().getJavaTypeName(), "22003", 1264, nfe);
          throw sqlException;
        }
      default:
        throw new SQLException(
            "getFloat not available for data field type " + columnInfo.getColumnType()
                .getJavaTypeName());
    }
    try {
      return Float.valueOf(String.valueOf(value));
    } catch (NumberFormatException nfe) {
      SQLException sqlException = new SQLException(
          "Incorrect format for getFloat for data field with type "
              + columnInfo.getColumnType().getJavaTypeName(), "22003", 1264, nfe);
      throw sqlException;
    }
  }
public float getInternalFloat ( ColumnInformation columnInfo ) throws SQLException { if ( lastValueWasNull ( ) ) { return 0 ; } long value ; switch ( columnInfo . getColumnType ( ) ) { case BIT : return parseBit ( ) ; case TINYINT : value = getInternalTinyInt ( columnInfo ) ; break ; case SMALLINT : case YEAR : value = getInternalSmallInt ( columnInfo ) ; break ; case INTEGER : case MEDIUMINT : value = getInternalMediumInt ( columnInfo ) ; break ; case BIGINT : value = ( ( buf [ pos ] & 0xff ) + ( ( long ) ( buf [ pos + 1 ] & 0xff ) << 8 ) + ( ( long ) ( buf [ pos + 2 ] & 0xff ) << 16 ) + ( ( long ) ( buf [ pos + 3 ] & 0xff ) << 24 ) + ( ( long ) ( buf [ pos + 4 ] & 0xff ) << 32 ) + ( ( long ) ( buf [ pos + 5 ] & 0xff ) << 40 ) + ( ( long ) ( buf [ pos + 6 ] & 0xff ) << 48 ) + ( ( long ) ( buf [ pos + 7 ] & 0xff ) << 56 ) ) ; if ( columnInfo . isSigned ( ) ) { return value ; } BigInteger unsignedValue = new BigInteger ( 1 , new byte [ ] { ( byte ) ( value > > 56 ) , ( byte ) ( value > > 48 ) , ( byte ) ( value > > 40 ) , ( byte ) ( value > > 32 ) , ( byte ) ( value > > 24 ) , ( byte ) ( value > > 16 ) , ( byte ) ( value > > 8 ) , ( byte ) value } ) ; return unsignedValue . floatValue ( ) ; case FLOAT : int valueFloat = ( ( buf [ pos ] & 0xff ) + ( ( buf [ pos + 1 ] & 0xff ) << 8 ) + ( ( buf [ pos + 2 ] & 0xff ) << 16 ) + ( ( buf [ pos + 3 ] & 0xff ) << 24 ) ) ; return Float . intBitsToFloat ( valueFloat ) ; case DOUBLE : return ( float ) getInternalDouble ( columnInfo ) ; case DECIMAL : case VARSTRING : case VARCHAR : case STRING : case OLDDECIMAL : try { return Float . valueOf ( new String ( buf , pos , length , StandardCharsets . UTF_8 ) ) ; } catch ( NumberFormatException nfe ) { SQLException sqlException = new SQLException ( "Incorrect format for getFloat for data field with type " + columnInfo . getColumnType ( ) . getJavaTypeName ( ) , "22003" , 1264 , nfe ) ; throw sqlException ; } default : throw new SQLException ( "getFloat not available for data field type " + columnInfo . getColumnType ( ) . getJavaTypeName ( ) ) ; } try { return Float . valueOf ( String . valueOf ( value ) ) ; } catch ( NumberFormatException nfe ) { SQLException sqlException = new SQLException ( "Incorrect format for getFloat for data field with type " + columnInfo . getColumnType ( ) . getJavaTypeName ( ) , "22003" , 1264 , nfe ) ; throw sqlException ; } }
Get float from raw binary format.

@param columnInfo column information
@return float value
@throws SQLException if column is not numeric or is not in Float bounds.