53edeb1e0cb97474b77339f495f0e30b18bed35f
[clinton/guile-figl.git] / upstream-man-pages / manglsl / findMSB.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
3 "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
4 <refentry id="findMSB">
5 <refmeta>
6 <refmetainfo>
7 <copyright>
8 <year>2011</year>
9 <holder>Khronos Group</holder>
10 </copyright>
11 </refmetainfo>
12 <refentrytitle>findMSB</refentrytitle>
13 <manvolnum>3G</manvolnum>
14 </refmeta>
15 <refnamediv>
16 <refname>findMSB</refname>
17 <refpurpose>find the index of the most significant bit set to 1 in an integer</refpurpose>
18 </refnamediv>
19 <refsynopsisdiv><title>Declaration</title>
20 <funcsynopsis>
21 <funcprototype>
22 <funcdef>genIType <function>findMSB</function></funcdef>
23 <paramdef>genIType <parameter>value</parameter></paramdef>
24 </funcprototype> <funcprototype>
25 <funcdef>genIType <function>findMSB</function></funcdef>
26 <paramdef>genUType <parameter>value</parameter></paramdef>
27 </funcprototype>
28 </funcsynopsis>
29 </refsynopsisdiv>
30 <refsect1 id="parameters"><title>Parameters</title>
31 <variablelist>
32 <varlistentry>
33 <term><parameter>value</parameter></term>
34 <listitem>
35 <para>
36 Specifies the value whose bits to scan.
37 </para>
38 </listitem>
39 </varlistentry>
40 </variablelist>
41 </refsect1>
42 <refsect1 id="description"><title>Description</title>
43 <para>
44 <function>findMSB</function> returns the bit number of the most significant bit that is set to 1 in the binary
45 representation of <parameter>value</parameter>. For positive integers, the result will be the bit number
46 of the most significant bit that is set to 1. For negative integers, the result will be the bit number of the
47 most significant bit set to 0. For a <parameter>value</parameter> of zero or negative 1, -1 will be returned.
48 </para>
49 </refsect1>
50 <refsect1 id="versions"><title>Version Support</title>
51 <informaltable frame="topbot">
52 #VARTABLECOLS#
53 <thead>
54 #FUNCTABLEHEADER#
55 <row>
56 <entry>findMSB</entry>#newin40#
57 </row>
58 </thead>
59 </tgroup>
60 </informaltable>
61 </refsect1>
62 <refsect1 id="seealso"><title>See Also</title>
63 <para>
64 <citerefentry><refentrytitle>findLSB</refentrytitle></citerefentry>
65 </para>
66 </refsect1>
67 <refsect1 id="Copyright"><title>Copyright</title>
68 <para>
69 Copyright <trademark class="copyright"></trademark> 2011 Khronos Group.
70 This material may be distributed subject to the terms and conditions set forth in
71 the Open Publication License, v 1.0, 8 June 1999.
72 <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
73 </para>
74 </refsect1>
75 </refentry>