Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.0.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 > bitset

bitset

指定した位置のビットを設定

呼び出し手順

y = bitset(x, pos)

y = bitset(x, pos, v)

引数

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 の最大ビット数です.

v :

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

y :

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

説明

指定した位置posのビットを設定します.

// 9 は (01001)_2 です
// 5番目のビットを1に設定し,
//      (11001)_2 ( = 25)とします
bitset(uint8(9), 5)
expected = 25

// 25の5番目のビットを0に設定
bitset(uint8(25), 5, 0)
expected = 9

// 入力は正のdoubleにすることができます
bitset(25, 5, 0)
expected = 9
Report an issue
<< bitor bitwise bitxor >>

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:
Mon Feb 12 23:12:39 CET 2018