Jsctypes/api: Difference between revisions

Jump to navigation Jump to search
→‎Int64: clarify that hex strings require 0x
(→‎Int64: clarify that hex strings require 0x)
Line 361: Line 361:
== Int64 ==
== Int64 ==


:'''<code>ctypes.Int64(''n'')</code>''' or '''<code>new ctypes.Int64(''n'')</code>''' - If ''n'' is an integer-valued number such that -2<sup>63</sup> &le; ''n'' &lt; 2<sup>63</sup>, return a sealed <code>Int64</code> object with that value. Otherwise if ''n'' is a decimal or hexadecimal string (optionally with a leading minus sign) and represents a number within range, convert the string to an integer and construct an <code>Int64</code> object as above. Otherwise if ''n'' is an <code>Int64</code> or <code>UInt64</code> object, and represents a number within range, use the value to construct an <code>Int64</code> object as above. Otherwise throw a <code>TypeError</code>.
:'''<code>ctypes.Int64(''n'')</code>''' or '''<code>new ctypes.Int64(''n'')</code>''' - If ''n'' is an integer-valued number such that -2<sup>63</sup> &le; ''n'' &lt; 2<sup>63</sup>, return a sealed <code>Int64</code> object with that value. Otherwise if ''n'' is a string consisting of an optional minus sign followed by either decimal digits or <code>"0x"</code> or <code>"0X"</code> and hexadecimal digits, and the string represents a number within range, convert the string to an integer and construct an <code>Int64</code> object as above. Otherwise if ''n'' is an <code>Int64</code> or <code>UInt64</code> object, and represents a number within range, use the value to construct an <code>Int64</code> object as above. Otherwise throw a <code>TypeError</code>.


<code>Int64</code> objects have the following methods:
<code>Int64</code> objects have the following methods:
638

edits

Navigation menu