直接上代码,有需求的朋也可以查看下:
package com.sondon.dev_soceket.test;
/**
* @Project : 硬件通讯
* @Package : com.sondon.tcpip
* @Class : Test.java
* @Company 广州讯动网络科技有限公司
* @Author : 蔡文锋
* @DateTime:2015年4月2日 上午11:21:53
* @Blog:http://blog.csdn.net/caiwenfeng_for_23
* @Description : { 测试 }
*/
public class Test {
public static void main(String[] args) {
String s="3E1E9E9F";
Float value = Float.intBitsToFloat(Integer.valueOf(s.trim(), 16));
System.out.println(value);
Float f=0.15490197f;
System.out.println(Integer.toHexString(Float.floatToIntBits(f)));
}
}