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

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

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

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

bitor

ビット単位の論理和(OR)

呼び出し手順

z = bitor(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を返します.

x, y, z の大きさは同じです.

// '110000' : is the binary representation of 48 
// '100101' : is the binary representation of 37   
// '110101' : is the binary representation for the OR applied to the binary forms 48 and 37 
// so the decimal number corresponding to the OR  applied to binary forms 48 and 37 is : 53
x=48; 
y=37;
z=bitor(x,y)
// Compute the bitwise OR of two matrices of doubles.
x=[12,45]; 
y=[25,49];
z=bitor(x,y)
// Compute the bitwise OR of two matrices of doubles.
x = [0 1 0 1];
y = [0 0 1 1];
z = bitor(x, y)
expected = [0 1 1 1];
// Compute the bitwise OR of two matrices of integers.
x = uint8([0 1 0 1]);
y = uint8([0 0 1 1]);
z = bitor(x, y)
// The types of x and y cannot be mixed (error).
x = [0 1 0 1];
y = uint8([0 0 1 1]);
// z = bitor(x, y)
//  13 is (01101)_2
//  27 is (11011)_2
//  OR is (11111)_2 which is 31.
bitor(uint8(13), uint8(27))
bitor(13, 27)

参照

  • bitand — ビット単位の論理積(AND)
  • bin2dec — 2進表現を整数に変換
  • dec2bin — 10進数から2進数への変換
Report an issue
<< bitget bitwise bitset >>

Copyright (c) 2022-2024 (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:
Wed Apr 01 10:24:59 CEST 2015