hax / hax/hax.github.com

各种可能的运算符(Operator)

Open
#3 0 comments 0 reactions 0 assignees View on GitHub
资源整理
Dominant language
HTML
Stars
464
Forks
27
PR merge metrics
No merged PRs in 30d

Description

## 普通四则运算

a + b => a + b
a - b => a − b
a \* b => a × b
a / b => a ÷ b
## 整除取模

a div b
a mod b / a %% b
a divmod b
a quot b
a rem b / a % b
a quotrem b

问题:
0. xpath中div表示除法,而常见语言的divmod中div表示整除
0. 同时取两个值的运算 divmod / quotrem 除了性能优化是否有足够用例?
## 乘方运算

a *\* b
## 相等性

a == b => a = b
a != b => a ≠ b
a === b => a ≡ b
a !== b => a ≢ b
## 顺序

a > b
a < b
a >= b => a ≥ b
a <= b => a ≤ b
a <> b
a <=> b
a > b > c
a >? b / max(a, b)
a b 和 a != b 的关系?
0. a <=> b 除了实现运算符重载外是否有足够用例?
## 匹配

a ~= b => a ≃ b
a !~= b => a ≄ b
## 逻辑运算

!a / not a => ¬ a
a && b / a and b => a ∧ b
a || b / a or b => a ∨ b
a xor b => a ⊻ b
a nand b => a ⊼ b
a nor b => a ⊽ b
## 从属关系

a in b => a ∈ b
a not in b => a ∉ b
a contains b => a ∋ b
a not contains b => a ∌ b
## 位运算

~ a
a & b
a | b
a ^ b
a << b
a >> b
a >>> b
a <<<< b 循环移位?
a >>>> b 循环移位?
## 管道、函数组合

a | f
a | f 100, _
a, b | f _1 + _2

g . f / g << f
f | g / f >> g

do f a, b, c
##

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.