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.
我一直在寻找一种将浮动转换为固定 0.32 的简单方法。有没有人有一些有用的链接或论文?
乘以 2**32 并使用普通转换为整数。
如果您需要以某种特定方式处理超出范围的值,这可能会使事情变得有些复杂;通常情况下,它们要么被忽略,要么在转换之前被简单地钳制。