Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.5.1 - 日本語

Change language to:
English - Français - Português - Русский

Please note that the recommended version of Scilab is 2024.0.0. This page might be outdated.
See the recommended documentation of this function

Scilabヘルプ >> Elementary Functions > bitwise > bitxor

bitxor

ビット単位の排他的論理和(XOR)

呼び出し手順

z = bitxor(x, y)

引数

x :

mn列の行列(double) またはm1 x m2 x ... x mm ハイパー行列(double) または符合なし整数(uint8, uint16または uint32)のmn列行列. 値は正の整数値である必要があります.

y :

mn列の行列(double) またはm1 x m2 x ... x mm ハイパー行列(double) または符合なし整数(uint8, uint16または uint32)のmn列行列. 値は正の整数値である必要があります.

z :

mn列の行列(double) またはm1 x m2 x ... x mm ハイパー行列(double) またはmn列の符号無し整数の行列.

説明

2つの正の整数xおよびyを指定すると, この関数は2進形式が xおよび yの2進形式の排他的論理和 となるような10進数zを返します.

// 2つのdouble行列のビット毎のXORを計算
x = [0 1 0 1];
y = [0 0 1 1];
z = bitxor(x, y)
expected = [0 1 1 1];

// 2つの整数行列のビット毎のXORを計算
x = uint8([0 1 0 1]);
y = uint8([0 0 1 1]);
z = bitxor(x, y)

// xとyの型を混在できません (エラー).
x = [0 1 0 1];
y = uint8([0 0 1 1]);
// z = bitxor(x, y)

//  13 は (01101)_2 です
//  27 は (11011)_2 です
// XOR は (10110)_2 , つまり 22です.
bitxor(uint8(13), uint8(27))
bitxor(13, 27)
Report an issue
<< bitset bitwise isequalbitwise >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu Oct 02 13:58:21 CEST 2014