主題
Search

小數部分


函式 frac(x) 給出實數 x 的小數(非整數)部分。符號 {x} 有時被用來代替 frac(x) (Graham 等,1994,第 70 頁;Havil 2003,第 109 頁),但由於可能與包含元素 x 的集合混淆,因此本作品中未使用此符號。

FractionalPart

遺憾的是,對於 frac(x)x<0 的含義沒有普遍的共識,並且有兩個常見的定義。設 |_x_| 為向下取整函式,則 Wolfram 語言命令FractionalPart[x] 定義為

 frac(x)={x-|_x_|   x>=0; x-[x]   x<0
(1)

(左圖)。這個定義的好處是 frac(x)+int(x)=x,其中 int(x)x 的整數部分。雖然 Spanier 和 Oldham (1987) 使用與 Wolfram 語言相同的定義,但他們只是非常簡短地提到了這個公式,然後表示不會進一步使用。Graham 等 (1994,第 70 頁),以及也許大多數其他數學家,使用不同的定義

 frac(x)=x-|_x_|,
(2)

(右圖)。

FractionalPartReImAbs
最小值 最大值
Re
Im Powered by webMathematica

小數部分函式也可以擴充套件到複平面,定義為

 frac(x+iy)=frac(x)+ifrac(y)
(3)

如上圖所示。

由於關於小數部分/值和整數部分/值的用法可能會令人困惑,下表總結了使用的名稱和符號。這裡,S&O 指的是 Spanier 和 Oldham (1987)。

符號名稱S&OGraham 等人Wolfram 語言
[x]天花板函式--天花板, 最小整數Ceiling[x]
mod(m,n)同餘----Mod[m, n]
|_x_|地板函式Int(x)地板, 最大整數, 整數部分Floor[x]
x-|_x_|小數值frac(x)小數部分或 {x}SawtoothWave[x]
sgn(x)(|x|-|_|x|_|)小數部分Fp(x)無名稱FractionalPart[x]
sgn(x)|_|x|_|整數部分Ip(x)無名稱IntegerPart[x]
nint(x)最近整數函式----Round[x]
m\n----Quotient[m, n]

與後一個定義相對應的(可能縮放的)週期性波形被稱為鋸齒波。

FractionalPartIntegral

上面所示的 1/x 的小數部分具有有趣的解析積分

int_(1/2)^1frac(1/x)dx=int_(1/2)^1(1/x-1)dx
(4)
=ln2-1/2
(5)
int_(1/3)^(1/2)frac(1/x)dx=int_(1/3)^(1/2)(1/x-2)dx
(6)
=ln3-ln2-1/3
(7)
int_(1/4)^(1/3)frac(1/x)dx=int_(1/4)^(1/3)(1/x-3)dx
(8)
=ln4-ln3-1/4.
(9)

積分

 I=int_0^1frac(1/x)dx
(10)

因此是由下式給出的伸縮和

I=lim_(n->infty)[lnn-sum_(k=2)^(n)1/k]
(11)
=lim_(n->infty)(1+lnn-H_n)
(12)
=1-gamma,
(13)

其中 gamma 是尤拉-馬歇羅尼常數,H_n 是調和數。

FractionalPartIntegral2

另一個可以用閉合形式完成並給出相同結果的相關積分是

 int_1^infty(frac(x))/(x^2)dx=1-gamma
(14)

(Havil 2003, pp. 109-111)。

FractionalPartNLogN

上面的圖顯示了 nlnn1<=n<=10^5 範圍內的小數部分,顯示了特徵間隙(Trott 2004,p. 223)。

Weyl 準則的一個結果是,對於無理數 x,序列 {frac(nx)} 在區間 [0,1] 內是稠密的且等分佈的,其中 n=1, 2, ... (Finch 2003)。


另請參閱

Beatty 序列, 天花板函式, 等分佈序列, 地板函式, 高斯對映, 整數部分, Mod, 最近整數函式, 冪小數部分, , 鋸齒波, 移位變換, 截斷, 整數

相關的 Wolfram 網站

http://functions.wolfram.com/IntegerFunctions/FractionalPart/

使用 探索

參考文獻

Finch, S. R. "Powers of 3/2 Modulo One." §2.30.1 in Mathematical Constants. Cambridge, England: Cambridge University Press, pp. 194-199, 2003.Graham, R. L.; Knuth, D. E.; and Patashnik, O. Concrete Mathematics: A Foundation for Computer Science, 2nd ed. Reading, MA: Addison-Wesley, 1994.Havil, J. Gamma: Exploring Euler's Constant. Princeton, NJ: Princeton University Press, pp. 109-110, 2003.Miklavc, A. "Elementary Proofs of Two Theorems on the Distribution of Numbers {nx} (mod 1)." Proc. Amer. Math. Soc. 39, 279-280, 1973.Sloane, N. J. A. Sequence A000079/M1129 in "The On-Line Encyclopedia of Integer Sequences."Spanier, J. and Oldham, K. B. "The Integer-Value Int(x) and Fractional-Value frac(x) Functions." Ch. 9 in An Atlas of Functions. Washington, DC: Hemisphere, pp. 71-78, 1987.Trott, M. The Mathematica GuideBook for Programming. New York: Springer-Verlag, 2004. http://www.mathematicaguidebooks.org/.

在 中被引用

小數部分

請這樣引用

Weisstein, Eric W. “小數部分。” 來自 Web 資源。 https://mathworld.tw/FractionalPart.html

學科分類