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 2024.0.0. This page might be outdated.
See the recommended documentation of this function

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

bitget

指定した位置のビットを取得

呼び出し手順

y = bitget(x,pos)

パラメータ

x :

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

pos :

mn列の行列(double)または m1 x m2 x ... x mm ハイパー行列(double) または符合なし整数( uint8, uint16 または uint32)の mn列行列. 入力 pos は 1,2,...,bitmax の範囲とする 必要があります.ただし, bitmaxx の最大ビット数です. 値は正の整数値である必要があります.

y :

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

説明

符合なし整数xを指定すると, この関数は xの二進数表現の pos 番目のビットを 符合なし整数y(0 または1 )として返します.

// 19 is (10011)_2
// The 2nd bit is 1 (starting from the end).
x=uint8(19);
pos=2;
y = bitget(x,pos)
expected = 1;
// 13 is (1101)_2
dec2bin(13)
bitget(uint8(13),4:-1:1)
// The input x can be a positive double
bitget(13,4:-1:1)
Report an issue
<< bitcmp bitwise bitor >>

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:
Wed Apr 01 10:24:59 CEST 2015