1 <?xml version="1.0" encoding="UTF-8"?>
4 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
5 * Copyright (C) 2011 - DIGITEO - Michael Baudin
6 * Copyright (C) 2008 - INRIA
8 * Copyright (C) 2012 - 2016 - Scilab Enterprises
10 * This file is hereby licensed under the terms of the GNU GPL v2.0,
11 * pursuant to article 5.3.4 of the CeCILL v.2.1.
12 * This file was originally licensed under the terms of the CeCILL v2.1,
13 * and continues to be available under such terms.
14 * For more information, see the COPYING file which you should have received
15 * along with this program.
18 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="bitor" xml:lang="en">
20 <refname>bitor</refname>
21 <refpurpose>bitwise OR</refpurpose>
30 <title>Parameters</title>
36 a <literal>m</literal>-by-<literal>n</literal> matrix of doubles
37 or a <literal>m1</literal>-by-<literal>m2</literal>-by-...-by-<literal>mm</literal> hypermatrix of doubles
38 or a <literal>m</literal>-by-<literal>n</literal> matrix of unsigned integers (<literal>uint8</literal>, <literal>uint16</literal> or <literal>uint32</literal>).
39 Must contain positive integer values.
47 a <literal>m</literal>-by-<literal>n</literal> matrix of doubles
48 or a <literal>m1</literal>-by-<literal>m2</literal>-by-...-by-<literal>mm</literal> hypermatrix of doubles
49 or a <literal>m</literal>-by-<literal>n</literal> matrix of unsigned integers (<literal>uint8</literal>, <literal>uint16</literal> or <literal>uint32</literal>).
50 Must contain positive integer values.
58 a <literal>m</literal>-by-<literal>n</literal> matrix of doubles
59 or a <literal>m1</literal>-by-<literal>m2</literal>-by-...-by-<literal>mm</literal> hypermatrix of doubles
60 or a <literal>m</literal>-by-<literal>n</literal> matrix of integers.
67 <title>Description</title>
69 Given <varname>x</varname> and <varname>y</varname> two positive integers, this function returns the decimal
70 number <varname>z</varname> whose the binary form is the OR of the binary representations
71 of <varname>x</varname> and <varname>y</varname>.
74 <varname>x</varname>, <varname>y</varname>, <varname>z</varname> have the same size.
78 <title>Examples</title>
79 <programlisting role="example"><![CDATA[
80 // '110000' : is the binary representation of 48
81 // '100101' : is the binary representation of 37
82 // '110101' : is the binary representation for the OR applied to the binary forms 48 and 37
83 // so the decimal number corresponding to the OR applied to binary forms 48 and 37 is : 53
88 // Compute the bitwise OR of two matrices of doubles.
93 // Compute the bitwise OR of two matrices of doubles.
99 // Compute the bitwise OR of two matrices of integers.
100 x = uint8([0 1 0 1]);
101 y = uint8([0 0 1 1]);
104 // The types of x and y cannot be mixed (error).
106 y = uint8([0 0 1 1]);
111 // OR is (11111)_2 which is 31.
112 bitor(uint8(13), uint8(27))
117 <refsection role="see also">
118 <title>See also</title>
119 <simplelist type="inline">
121 <link linkend="bitand">bitand</link>
124 <link linkend="bin2dec">bin2dec</link>
127 <link linkend="dec2bin">dec2bin</link>