Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法转换 IEEE 单精度(32 位)列表:
String result = getdata(); String[] floats = result.split(","); List<String> floatList = Arrays.asList(floats);
浮点数据最终来自另一个IEEE 754 single-precision (32-bit) floating-point number从字节流生成的模块。
IEEE 754 single-precision (32-bit) floating-point number
现在我正在尝试将浮点值编译回 Java 中的字节流。
如果浮点值存储为字符串中的文本,您可以简单地将它们逐个数字地转换:
float[] floatValues = new float[floats.length] for (int i=0; i< floats.length; i++) { floatValues[i] = Float.parseFloat(floats[i]); }