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.
可能重复: 32 位到 16 位浮点转换
如何在 C 中转换 32 位浮点数和 16 位半精度浮点数?
我建议你检查一下这个half_floats
您还应该考虑存储这些半浮点数的方式(C 中没有这种类型)
由于 C 通常没有内置的 16 位浮点类型,我希望您要么必须
unsigned short
这两个都假设您想要做的只是构建值的表示,当然您不能使用 C 的运算符进行算术运算。