What is the fastest way to convert float to int on x86

前端 未结 10 2230
轻奢々
轻奢々 2020-11-28 11:26

What is the fastest way you know to convert a floating-point number to an int on an x86 CPU. Preferrably in C or assembly (that can be in-lined in C) for any combination of

10条回答
  •  粉色の甜心
    2020-11-28 11:56

    Generally, you can trust the compiler to be efficient and correct. There is usually nothing to be gained by rolling your own functions for something that already exists in the compiler.

提交回复
热议问题