x64上的快速逆平方根 [英] Fast Inverse Square Root on x64

查看:138
本文介绍了x64上的快速逆平方根的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 http://en.wikipedia.org/wiki/Fast_inverse_square_root的网上快速反平方根上找到了。在x64上可以正常使用吗?
是否有人使用过并经过严格测试?

I found on net Fast Inverse Square Root on http://en.wikipedia.org/wiki/Fast_inverse_square_root . Does it work properly on x64 ? Did anyone use and serious test ?

推荐答案

最初,快速逆平方根是为32位浮点数编写的,只要您使用IEEE-754浮点数即可点表示形式,x64体系结构将不会影响结果。

Originally Fast Inverse Square Root was written for a 32-bit float, so as long as you operate on IEEE-754 floating point representation, there is no way x64 architecture will affect the result.

请注意,对于双精度精度浮点(64位),应使用另一个常量: / p>

Note that for "double" precision floating point (64-bit) you should use another constant:


... 64位IEEE754大小类型double的幻数显示为正好为0x5fe6eb50c7b537a9

...the "magic number" for 64 bit IEEE754 size type double ... was shown to be exactly 0x5fe6eb50c7b537a9

这篇关于x64上的快速逆平方根的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆