2.9999999999999999 >> .5?

后端 未结 10 2171
悲&欢浪女
悲&欢浪女 2021-02-07 16:04

I heard that you could right-shift a number by .5 instead of using Math.floor(). I decided to check its limits to make sure that it was a suitable replacement, so I checked the

10条回答
  •  [愿得一人]
    2021-02-07 16:19

    It should be noted that the number ".0000000000000007779553950749686919152736663818359374" is quite possibly the Epsilon, defined as "the smallest number E such that (1+E) > 1."

提交回复
热议问题