V2EX  ›  英汉词典

Xor

定义 Definition

xor(常写作 XOR)指“异或 / 排他或”(exclusive OR):在逻辑或计算机运算中,两个条件(或两位)中恰好有一个为真/为 1时结果为真/为 1;若两者相同(都真或都假;都 1 或都 0),结果为假/为 0。它也可指“异或运算/异或操作”。

发音 Pronunciation (IPA)

/ˌɛksˈɔːr/

词源 Etymology

xor 来自短语 exclusive or 的缩写写法(在逻辑学与计算机科学中常用)。之所以称为“排他或”,是因为它排除了普通 “or” 中“两个都为真也算真”的情况,强调“只能有一个为真”。

例句 Examples

Xor returns 1 when the two bits are different.
异或在两位不相同时返回 1。

In many programming languages, you can use xor to toggle flags efficiently without using extra memory.
在许多编程语言中,你可以用异或高效地“切换”标志位,而不需要额外内存。

相关词 Related Words

文学与作品 Literary Works

  • The C Programming Language(Kernighan & Ritchie):介绍按位运算符时涉及 XOR^)的用法与示例。
  • Code: The Hidden Language of Computer Hardware and Software(Charles Petzold):讲解逻辑门与数字电路时会提到“异或”这一逻辑运算。
  • Introduction to Algorithms(Cormen, Leiserson, Rivest, Stein):在位运算与相关算法分析的语境中常出现 XOR
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   3232 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 14ms · UTC 09:20 · PVG 17:20 · LAX 01:20 · JFK 04:20
♥ Do have faith in what you're doing.