1. 程式人生 > 其它 >Babbage difference and Quake's Fast Inverse Square Root

Babbage difference and Quake's Fast Inverse Square Root

Understanding Quake’s Fast Inverse Square Root – BetterExplained

在某個帖子裡我放過厥詞"Quake判斷某個整數是不是平方數"。說錯了。判斷是不是平方數步長為2n+1一點都不高檔;輸入為32位時,16步可以判斷出。

該文說到:Floating-point numbers are stored by computers in mantissa-exponent form.

mantissa是啥?網上說: When a regular number is written in scientific notation, it is written with two significant components: the mantissa and the exponent. 即52976 = 5.2976E4, 5.2976 is the mantissa.

另一種我認為準確的說法: 52796 = 10 ** 4.722601020190381, the mantissa is 0.722601020190381,即the fractional part of a common logarithm representing the digits of the associated number but not its magnitude,詞源: Latin: 'sth added', of Etruscan origin. 伊特魯里亞文明是伊特魯里亞地區(今義大利半島及科西嘉島)於公元前12世紀至前1世紀所發展出來的文明。該文明的全盛時期為前6世紀。

IEEE Standard for Binary Floating-Point Arithmetic (754-1985):Numbers in the single and double formats are composed of the following three fields:
1) 1-bit sign s
2) Biased exponent e
3) Fraction f = b1

b2...bp-1

The common logarithm is the logarithm with base 10. The natural logarithm of a number is its logarithm to the base of the mathematical constant e. Log base 2, also known as binary logarithm which is the inverse function of the power of two functions.