如何使用位操作来做\sqrt(n) [英] how to use bit operation to do \sqrt(n)

查看:103
本文介绍了如何使用位操作来做\sqrt(n)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

n是一个32位整数,如何计算

sqrt(n)

我知道高(n)是该值,但如何使用位操作来实现此功能。


提前感谢。


你的



hello all,
n is an 32bit-integer, how to calculate
sqrt(n)
I know high(n) is the the value, but how to use bit operation to
implement this function.

thanks in advance.

yours
Yin

推荐答案

Thomas Zhu写道:
Thomas Zhu wrote:

n是一个32位整数,如何计算

sqrt(n)

我知道高(n)是该值,但如何使用位操作到

实现此功能。
n is an 32bit-integer, how to calculate
sqrt(n)
I know high(n) is the the value, but how to use bit operation to
implement this function.

http://www.pobox.com /~qed/sqroot.html


-

Paul Hsieh
http://www.pobox.com/~qed/
http://bstring.sf.net/

http://www.pobox.com/~qed/sqroot.html

--
Paul Hsieh
http://www.pobox.com/~qed/
http://bstring.sf.net/




Thomas Zhu写道:

Thomas Zhu wrote:

你好所有,

n是一个32位整数,如何计算

sqrt(n)

我知道高(n)是该值,但如何使用位操作来实现此功能。


提前感谢。


你的

Yin
hello all,
n is an 32bit-integer, how to calculate
sqrt(n)
I know high(n) is the the value, but how to use bit operation to
implement this function.

thanks in advance.

yours
Yin




你指的是sqrt(n)的定点实现

什么是高(n)?


再见,
快点。



are you referring to fixed point implementation of sqrt(n)
what is high(n)?

bye,
hurry.




快点w死记硬背:

hurry wrote:

你指的是sqrt(n)的定点实现

什么是高(n)?
are you referring to fixed point implementation of sqrt(n)
what is high(n)?



如果n表示为二进制字符串,前半部分是sqrt(n),

是高(n)

if n is represented as a binary string, the first half is the sqrt(n),
which is high(n)


这篇关于如何使用位操作来做\sqrt(n)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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