Float or Double?

前端 未结 8 1945
北海茫月
北海茫月 2020-12-29 20:36

Which is faster, double or float, when preforming arithimic (+-*/%), and is it worth just using float for memory reasons? Precision is not an issue much of an issue.

8条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-29 21:18

    The processing speed on both types should approximately be the same in CPUs nowadays.

    "use whichever precision is required for acceptable results."

    Related questions have been asked a couple of times here on SO, here is one.

    Edit:

    In speed terms, there's no difference between float and double on the more modern hardware.

    Please check out this article from developer.android.com.

提交回复
热议问题