當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Julia nand用法及代碼示例

用法:

nand(x, y)
⊼(x, y)

xy 的按位與非(非與)。實現 three-valued logic ,如果參數之一是 missing ,則返回 missing

中綴操作 a ⊼ bnand(a,b) 的同義詞,而 可以通過 Julia REPL 中的製表符完成 \nand\barwedge 來鍵入。

例子

julia> nand(true, false)
true

julia> nand(true, true)
false

julia> nand(true, missing)
missing

julia> false ⊼ false
true

julia> [true; true; false] .⊼ [true; false; false]
3-element BitVector:
 0
 1
 1

相關用法


注:本文由純淨天空篩選整理自julialang.org 大神的英文原創作品 Base.nand — Function。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。