FFI: Add 64 bit bitwise operations.
This commit is contained in:
@@ -730,6 +730,22 @@ You'll have to explicitly convert a 64 bit integer to a Lua
|
||||
number (e.g. for regular floating-point calculations) with
|
||||
<tt>tonumber()</tt>. But note this may incur a precision loss.</li>
|
||||
|
||||
<li><b>64 bit bitwise operations</b>: the rules for 64 bit
|
||||
arithmetic operators apply analogously.<br>
|
||||
|
||||
Unlike the other <tt>bit.*</tt> operations, <tt>bit.tobit()</tt>
|
||||
converts a cdata number via <tt>int64_t</tt> to <tt>int32_t</tt> and
|
||||
returns a Lua number.<br>
|
||||
|
||||
For <tt>bit.band()</tt>, <tt>bit.bor()</tt> and <tt>bit.bxor()</tt>, the
|
||||
conversion to <tt>int64_t</tt> or <tt>uint64_t</tt> applies to
|
||||
<em>all</em> arguments, if <em>any</em> argument is a cdata number.<br>
|
||||
|
||||
For all other operations, only the first argument is used to determine
|
||||
the output type. This implies that a cdata number as a shift count for
|
||||
shifts and rotates is accepted, but that alone does <em>not</em> cause
|
||||
a cdata number output.
|
||||
|
||||
</ul>
|
||||
|
||||
<h3 id="cdata_comp">Comparisons of cdata objects</h3>
|
||||
@@ -1222,7 +1238,6 @@ value.</li>
|
||||
Other missing features:
|
||||
</p>
|
||||
<ul>
|
||||
<li>Bit operations for 64 bit types.</li>
|
||||
<li>Arithmetic for <tt>complex</tt> numbers.</li>
|
||||
<li>Passing structs by value to vararg C functions.</li>
|
||||
<li><a href="extensions.html#exceptions">C++ exception interoperability</a>
|
||||
|
||||
Reference in New Issue
Block a user