Why are there so many floats in the Android API?

前端 未结 5 1024
梦谈多话
梦谈多话 2021-02-07 09:46

The default floating point type in Java is the double. If you hard code a constant like 2.5 into your program, Java makes it a double automatically. When you do a

5条回答
  •  借酒劲吻你
    2021-02-07 10:28

    Depending on the CPU there will be no Floating Point Unit (FPU). So it has to emulate the FPU in Software. this is faster for a Float than for a Double. Or if the Device has a FPU it will be probably also be faster with Floats.

提交回复
热议问题