And 
范例
打开所有单元 关闭所有单元基本范例 (4)
范围 (5)
And 的参数可以为任意个:
And[x, y, z]And 具有结合性:
And[x, And[y, z]]//FullForm具有显式 True 或 False 参数的 And 将简化:
And[x, True, z]And[x, False, z]And 按顺序计算其参数,当一个参数计算为 False 时停止:
And[Print[1];False, Print[2];True]And[Print[1];True, Print[2];True]x ≠ 0 && y == 1 / x /. x -> 0y == 1 / x && x ≠ 0 /. x -> 0z && y && y && xSimplify[%]TraditionalForm 格式输出:
x && y && z//TraditionalForm应用 (6)
PositiveNumberQ[x_] := NumberQ[x] && Head[x] =!= Complex && x > 0PositiveNumberQ[1]如果 And 的一个参数计算为 False,随后的任意参数将不再计算:
PositiveNumberQ[I]And 中参数的次序很重要,如果我们倒换最后两个参数,则计算为 I>0:
PositiveNumberQ2[x_] := NumberQ[x] && x > 0 && Head[x] =!= ComplexPositiveNumberQ2[I]Refine[(a ^ b) ^ c, a ≥ 0 && Element[b, Reals]]组合方程及不等式;And 既用于输入也用于输出:
Reduce[x ^ 2 + y ^ 2 == 1 && x ≥ y, {x, y}]利用 And 组合各种条件:
RegionPlot[x ^ 2 + y ^ 2 < 1 && x + y > 0, {x, -2, 2}, {y, -2, 2}]RegionPlot3D[x ^ 2 + y ^ 2 + z ^ 2 < 1 && x ^ 2 + y ^ 2 < z ^ 2, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}]基于 And 的元胞自动机:
ArrayPlot[Boole[CellularAutomaton[{And@@#&, {}}, RandomChoice[{True, False}, 40], 20]]]Integrate[Boole[x ^ 2 + y ^ 2 < 1 && (x - 1) ^ 2 + y ^ 2 < 2], {x, -Infinity, Infinity}, {y, -Infinity, Infinity}]RegionPlot[x ^ 2 + y ^ 2 < 1 && (x - 1) ^ 2 + y ^ 2 < 2, {x, -1.5, 2.5}, {y, -2, 2}]属性和关系 (8)
二元 And 的真值表:
BooleanTable[{x, y, And[x, y]}, {x, y}]//Grid三元 And:
BooleanTable[{x, y, z, And[x, y, z]}, {x, y, z}]//GridAnd[]具有单一参数的 And 将返回运算后的参数,无论值如何:
And[2 + 2]p || q && r//FullForm利用 BooleanConvert 相对于 Or 展开 And:
(a || b) && (c || d || e)BooleanConvert[%]BooleanConvert[!(a && b)]BooleanConvert[!(a || b || c)]Boole[a]Boole[b] - Boole[a && b]Simplify[%]Min[Boole[a], Boole[b]] - Boole[a && b]Simplify[%]利用 Thread 线性作用于列表:
{p, q} && {r, s}Thread[%]参见
BooleanConvert LogicalExpand BitAnd Nand Or Not Conjunction Intersection BooleanCountingFunction AllTrue
字符: \[And]
Function Repository: VennDiagram
技术笔记
历史
1988年引入 (1.0) | 在以下年份被更新:1996 (3.0)
文本
Wolfram Research (1988),And,Wolfram 语言函数,https://reference.wolfram.com/language/ref/And.html (更新于 1996 年).
CMS
Wolfram 语言. 1988. "And." Wolfram 语言与系统参考资料中心. Wolfram Research. 最新版本 1996. https://reference.wolfram.com/language/ref/And.html.
APA
Wolfram 语言. (1988). And. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/And.html 年
BibTeX
@misc{reference.wolfram_2026_and, author="Wolfram Research", title="{And}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/And.html}", note=[Accessed: 17-August-2026]}
BibLaTeX
@online{reference.wolfram_2026_and, organization={Wolfram Research}, title={And}, year={1996}, url={https://reference.wolfram.com/language/ref/And.html}, note=[Accessed: 17-August-2026]}