Browse Source

1、IEEE754浮点型优化;

prod_202403
mh 8 months ago
parent
commit
c331d15b35
  1. 5
      user-service/src/main/java/com/mh/user/utils/ExchangeStringUtil.java

5
user-service/src/main/java/com/mh/user/utils/ExchangeStringUtil.java

@ -1010,9 +1010,8 @@ public class ExchangeStringUtil {
* @date: 2021/9/10 16:57 * @date: 2021/9/10 16:57
*/ */
public static float hexToSingle(String s ) { public static float hexToSingle(String s ) {
int ieee754Int = Integer.parseInt(s, 16); BigInteger data = new BigInteger(s,16);
float realValue = Float.intBitsToFloat(ieee754Int); return Float.intBitsToFloat(data.intValue());
return realValue;
} }
//判断字符串是否为json格式 //判断字符串是否为json格式

Loading…
Cancel
Save