Floor 
更多信息
- 数学函数,适宜于符号和数值计算.
- 可以用 ⌊x⌋、
lf
rf
或
\[LeftFloor]x \[RightFloor] 以 StandardForm 和 InputForm 输入 Floor[x]. »
是任意数值型量 (numeric quantity) 时,Floor[x] 返回一个整数,不管它是否是一个明确的数字. »- Floor[x] 分别作用于复数的实部和虚部.
- 如果 a 不是正实数,Floor[x,a] 由公式 Floor[x,a]a Floor[x/a] 定义. »
- 对于精确的数值型量,Floor 内部使用数值近似得到结果. 全局变量 $MaxExtraPrecision 的设置可能影响计算过程.
- Floor 自动逐项作用于列表的各个元素. »
范例
打开所有单元 关闭所有单元基本范例 (4)
Floor[2.4]Floor[2.6]Floor[226, 10]Plot[Floor[x, 10], {x, -30, 30}]用
lf
或
rf
输入 Floor 的短符号:
⌊x⌋范围 (30)
数值计算 (7)
Floor[5.37]Floor[-3.7]Floor[-10.3, 3.5]Floor[2Pi - E, 5 / 4]Floor[5.37 - 1.3I]单参数的 Floor 总是返回精确结果:
Floor[123.4`45]Floor[100`45, 13.2456`10]Floor[7545 / 4660`10000]//TimingN[Floor[(E + Pi) ^ 2 - E ^ 2 - Pi ^ 2 - 2 E Pi], 10^5]//Quiet//TimingFloor 可以处理实数区间:
Floor[Interval[{-1, 3 / 2}]]用 Around 计算一般情况下的统计区间:
Floor[ Around[-1, 0.01]]**Floor**[{{1 / 2, -1}, {0, -1 / 2}}]或用 MatrixFunction 计算矩阵形式的 Floor 函数:
MatrixFunction[Floor, {{1 / 2, -1}, {0, -1 / 2}}]特殊值 (6)
Floor 在固定点处的值:
Table[Floor[n], {n, {1 / 7, 5 / 4, 7 / 3, 7 / 2}}]Floor[0]Infinity 处的值:
Floor[∞]PiecewiseExpand[Floor[x, 2], 0 < x < 4]以符号方式操纵 Floor:
Simplify[Floor[x] + Floor[x + 1]]Reduce[Floor[x] + Floor[2x - 1] == 0, x, Reals]xval = x /. FindRoot[Floor[x] == 2, {x, 2.5}]Plot[Floor[x], {x, -1, 4}, Epilog -> Style[Point[{xval, Floor[xval]}], PointSize[Large], Red], ExclusionsStyle -> Dotted]可视化 (4)
绘制 Floor 函数:
Plot[Floor[x], {x, -3, 3}, Filling -> Axis]Plot[Floor[x, .5], {x, -3, 3}, Filling -> Axis]绘制三维中的 Floor:
Plot3D[Floor[x, y], {x, -3, 3}, {y, -3, 3}, ColorFunction -> "BlueGreenYellow"]在复平面上可视化 Floor:
ComplexPlot3D[Floor[z], {z, 3}, PlotLegends -> Automatic]函数的属性 (9)
Floor 对所有实数和复数输入有定义:
FunctionDomain[Floor[x], x]FunctionDomain[Floor[x], x, Complexes]Floor 可以产生无限大和无限小的结果:
FunctionRange[Floor[x], x, y]//QuietFloor 不是解析函数:
FunctionAnalytic[Floor[x], x]FunctionSingularities[Floor[x], x]FunctionDiscontinuities[Floor[x], x]Floor 非递减:
FunctionMonotonicity[Floor[x], x]Floor 不是单射函数:
FunctionInjective[Floor[x, 5], x]Plot[{Floor[x, 5], 5}, {x, -20, 20}, PlotStyle -> {Thick}]Floor 不是满射函数:
FunctionSurjective[Floor[x, 5], x]Plot[{Floor[x, 5], -2}, {x, -20, 20}, PlotStyle -> {Thick}]Floor 既不是非负,也不是非正:
FunctionSign[Floor[x], x]Floor 既不凸,也不凹:
FunctionConvexity[Floor[x], x]TraditionalForm 格式:
Floor[x]//TraditionalForm微分与积分 (4)
D[Floor[x], x]D[Floor[x, a], a]//FullSimplifyFloor 的定积分:
Integrate[Floor[x], {x, 0, E}]Integrate[Floor[x ^ 2], {x, 0, 3}]Series[Floor[x ^ 2], {x, 1, 2}, Assumptions -> Element[x, Reals]]应用 (4)
Plot[Floor[x + x ^ 2], {x, -3, 3}]Plot3D[Floor[x y], {x, -2, 2}, {y, -2, 2}]Floor[10 Mod[PowerMod[10, 10 ^ 6 - 1, 997], 997] / 997]RealDigits[1 / 997, 10, 10 ^ 6, -1][[1, -1]]PowerExpand[Sqrt[z ^ 2], Assumptions -> {z∈Reals}]
PowerExpand[Log[1 / z], Assumptions -> {z > 0}]PowerExpand[Sqrt[z ^ 2], Assumptions -> {}]
PowerExpand[Log[1 / z], Assumptions -> {}]属性和关系 (12)
Floor[{-2.4, -2.5, -2.6}]对于 a>0,Floor[x,a] 给出小于或等于 x 的 a 的最大倍数:
Floor[16, 3]对于取其他值的 a,Floor[x,a] 由以下公式定义:
FunctionExpand[Floor[x, a]]{Floor[x, a], %} /. {x -> 16, a -> -3}FullSimplify[Floor[x, -a] == Ceiling[x, a]]PiecewiseExpand[Floor[x ^ 2], 0 < x < 2]去嵌套 Floor 函数:
PiecewiseExpand[Floor[x + 1 / 3 + Floor[1 - x / 2] ^ 3], -1 < x < 1]从 PowerExpand 中获得的 Floor:
PowerExpand[Sqrt[z ^ 2], Assumptions -> {}]PowerExpand[ArcSin[Sin[z]], Assumptions -> {}]化简包含 Floor 的方程:
Reduce[Floor[x + 1 / 2] == 3Floor[x ^ 2] - 2 && -2 < x < 2, x, Reals]复平面上的 Floor 函数:
ContourPlot[Abs[Floor[x + I y]], {x, -3, 3}, {y, -3, 3}]涉及到 Floor 的 Sum 表达式:
Sum[Floor[k / 3], {k, 1, n}, Assumptions -> n > 1]Sum[(k/Floor[k] + 1), {k, 1, n}]Floor 可被表示为 DifferenceRoot:
DifferenceRootReduce[Floor[k], k]DifferenceRootReduce[Floor[k, 3], k]Floor 的母函数:
GeneratingFunction[Floor[n, 4], n, x]Series[%, {x, 0, 10}]Floor 的指数母函数:
ExponentialGeneratingFunction[Floor[n, 4], n, x]可能存在的问题 (2)
巧妙范例 (3)
Table[Floor[Sqrt[2k] + 1 / 2], {k, 21}]探索一个包含 Floor 的和式的连分数:
Sum[1 / 2 ^ Floor[n / GoldenRatio], {n, 1, 10000}];Log[2, Take[ContinuedFraction[%], 15]]Table[Fibonacci[k], {k, -1, 13}]Floor 的 Fourier 级数的收敛:
Plot[Evaluate[Table[x + 1 / 2 - UnitStep[x] + Sum[Sin[2Pi k x] / k, {k, 1, o}] / Pi, {o, 10}]], {x, 0, 4}]技术笔记
-
▪
- 数值函数 ▪
- 分段函数 ▪
- 算符 ▪
- 关于内部实现的一些注释: 数值及相关函数
历史
1988年引入 (1.0) | 在以下年份被更新:1996 (3.0) ▪ 2007 (6.0)
文本
Wolfram Research (1988),Floor,Wolfram 语言函数,https://reference.wolfram.com/language/ref/Floor.html (更新于 2007 年).
CMS
Wolfram 语言. 1988. "Floor." Wolfram 语言与系统参考资料中心. Wolfram Research. 最新版本 2007. https://reference.wolfram.com/language/ref/Floor.html.
APA
Wolfram 语言. (1988). Floor. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/Floor.html 年
BibTeX
@misc{reference.wolfram_2026_floor, author="Wolfram Research", title="{Floor}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/Floor.html}", note=[Accessed: 10-November-2026]}
BibLaTeX
@online{reference.wolfram_2026_floor, organization={Wolfram Research}, title={Floor}, year={2007}, url={https://reference.wolfram.com/language/ref/Floor.html}, note=[Accessed: 10-November-2026]}