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

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 help >> Elementary Functions > bitwise > bitand

bitand

ビット単位の論理積(AND)

呼び出し手順

z = bitand(x,y)

パラメータ

x :

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

y :

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

z :

m行n列の行列(double)またはm1 x m2 x ... x mm ハイパー行列(double) または符合なし整数.

説明

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

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

// '1010110' : is the binary representation of 86 
// '1011011' : is the binary representation of 91   
// '1010010' : is the binary representation for the AND of binary representation 86 and 91 
// so the decimal number corresponding to the AND  applied to binary forms 86 and 91 is : 82
x=86; 
y=91;
z=bitand(x,y)

// Compute the bitwise AND of two matrices of doubles.
x=[12,45];
y=[25,49];
z=bitand(x,y)

// Compute the bitwise AND of two matrices of doubles.
x = [0 1 0 1];
y = [0 0 1 1];
z = bitand(x, y)
expected = [0 0 0 1];

// Compute the bitwise AND of two matrices of integers.
x = uint8([0 1 0 1]);
y = uint8([0 0 1 1]);
z = bitand(x, y)

// The types of x and y cannot be mixed (error).
x = [0 1 0 1];
y = uint8([0 0 1 1]);
z = bitand(x, y)

//  13 is (01101)_2
//  27 is (11011)_2
// AND is (01001)_2 which is 9.
bitand(uint8(13), uint8(27))
bitand(13, 27)

作者

  • Copyright (C) 2011 - DIGITEO - Michael Baudin
  • Copyright (C) INRIA - Farid BELAHCENE
  • Copyright (C) 2008 - INRIA - Pierre MARECHAL

参照

  • bitor — ビット単位の論理和(OR)
  • bin2dec — 2進表現を整数に変換します
  • dec2bin — 2進表現
<< bitwise bitwise bitcmp >>

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 Oct 05 12:12:38 CEST 2011