更新时间:2023-12-06 16:49:16
在x86处理器,至少,浮动
和双
将每一个可以通过将FPU进行处理转换成一个10字节的真实。该FPU不具有独立的处理单元,它支持不同的浮点类型。
On x86 processors, at least, float
and double
will each be converted to a 10-byte real by the FPU for processing. The FPU doesn't have separate processing units for the different floating-point types it supports.
在古老的意见,浮动
比更快的双
进行100年前,当大多数CPU都没有有内置的FPU(和几个人有单独的FPU芯片),所以大部分的浮点操作软件完成。在这些机器上(这是由熔岩坑产生的蒸汽驱动),它的已的更快地使用浮动
秒。现在唯一的真正的好处浮动
s是,他们占用空间少(只有事项,如果你有百万人)。
The age-old advice that float
is faster than double
applied 100 years ago when most CPUs didn't have built-in FPUs (and few people had separate FPU chips), so most floating-point manipulation was done in software. On these machines (which were powered by steam generated by the lava pits), it was faster to use float
s. Now the only real benefit to float
s is that they take up less space (which only matters if you have millions of them).