主題
Search

整數部分


IntegerPart

函式 intx 給出 x 的整數部分。在許多計算機語言中,該函式表示為int(x)。它與 floor 函式ceiling 函式 |_x_|[x] 相關,關係如下

 int(x)={|_x_|   for x>=0; [x]   for x<0.
(1)

整數部分函式滿足

 int(-x)=-int(x)
(2)

並在 Wolfram 語言 中實現為IntegerPart[x]。此定義的選擇使得 int(x)+frac(x)=x,其中 frac(x)小數部分。雖然 Spanier 和 Oldham (1987) 使用與 Wolfram 語言 中相同的定義,但他們只是非常簡要地提到了這個公式,然後表示它將不再被進一步使用。Graham et al. (1994) 以及可能大多數其他數學家,將術語“整數”部分與 floor 函式 |_x_| 交替使用。

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

整數部分函式也可以擴充套件到複平面,如上圖所示。

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

符號名稱S&OGraham et al.Wolfram 語言
[x]ceiling 函式--ceiling,最小整數Ceiling[x]
mod(m,n)同餘----Mod[m, n]
|_x_|floor 函式Int(x)floor,最大整數,整數部分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]

另請參閱

Ceiling 函式, Floor 函式, 小數部分, 整數, Mod, 最近整數函式, Quotient

相關的 Wolfram 站點

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

使用 探索

參考文獻

Graham, R. L.; Knuth, D. E.; 和 Patashnik, O. Concrete Mathematics: A Foundation for Computer Science, 2nd ed. Reading, MA: Addison-Wesley, p. 67, 1994.Spanier, J. 和 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.

在 上引用

整數部分

引用為

Weisstein, Eric W. "整數部分。" 來自 Web 資源。 https://mathworld.tw/IntegerPart.html

主題分類