<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                ### 導航 - [索引](../genindex.xhtml "總目錄") - [模塊](../py-modindex.xhtml "Python 模塊索引") | - [下一頁](sequence.xhtml "Sequence Protocol") | - [上一頁](object.xhtml "Object Protocol") | - ![](https://box.kancloud.cn/a721fc7ec672275e257bbbfde49a4d4e_16x16.png) - [Python](https://www.python.org/) ? - zh\_CN 3.7.3 [文檔](../index.xhtml) ? - [Python/C API 參考手冊](index.xhtml) ? - [抽象對象層](abstract.xhtml) ? - $('.inline-search').show(0); | # 數字協議 int `PyNumber_Check`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o*)如果對象 *o* 提供數字的協議,返回真 `1`,否則返回假。這個函數不會調用失敗。 [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_Add`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o1*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*o2*)*Return value: New reference.*返回 *o1* 、*o2\*相加的結果,如果失敗,返回 \*NULL* 。等價于Python中的表達式 `o1 + o2`。 [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_Subtract`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o1*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*o2*)*Return value: New reference.*返回 *o1* 減去 *o2* 的結果,如果失敗,返回 *NULL* 。等價于Python中的表達式 `o1 - o2`。 [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_Multiply`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o1*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*o2*)*Return value: New reference.*返回\*o1\* 、*o2\*相乘的結果,如果失敗,返回 \*NULL* 。等價于Python中的表達式 `o1 * o2`。 [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_MatrixMultiply`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o1*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*o2*)*Return value: New reference.*返回\*o1\* 、*o2\*做矩陣乘法的結果,如果失敗,返回 \*NULL* 。等價于Python中的表達式 `o1 @ o2`。 3\.5 新版功能. [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_FloorDivide`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o1*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*o2*)*Return value: New reference.*返回 *o1* 除以 *o2* 的向下取整后的結果,如果失敗,返回 *NULL*。等價于"傳統"的整數除法。 [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_TrueDivide`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o1*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*o2*)*Return value: New reference.*返回 *o1* 除以 *o2* 的一個合理的近似值,如果失敗,返回 *NULL*。這個值是近似的是因為二進制浮點數是一個近似值,它不可能表示出以2為基數的所有實數。這個函數返回兩個整數相除得到的浮點數。 [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_Remainder`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o1*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*o2*)*Return value: New reference.*返回 *o1* 除以 *o2* 得到的余數,如果失敗,返回 *NULL*。等價于Python中的表達式 `o1 % o2`。 [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_Divmod`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o1*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*o2*)*Return value: New reference.*參考內置函數 [`divmod()`](../library/functions.xhtml#divmod "divmod")。如果失敗,返回 *NULL*。等價于Python中的表達式 `divmod(o1, o2)`。 [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_Power`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o1*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*o2*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*o3*)*Return value: New reference.*請參閱內置函數 [`pow()`](../library/functions.xhtml#pow "pow")。 如果失敗,返回 *NULL*。 等價于 Python 中的表達式 `pow(o1, o2, o3)`,其中 *o3* 是可選的。如果缺少 *o3*,則傳入 [`Py_None`](none.xhtml#c.Py_None "Py_None") 作為代替(如果傳入 *NULL* 會導致非法內存訪問)。 [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_Negative`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o*)*Return value: New reference.*返回 *o* 的負值,如果失敗,返回 *NULL* 。等價于Python中的表達式 `-o`。 [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_Positive`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o*)*Return value: New reference.*返回 *o* ,如果失敗,返回 *NULL* 。等價于Python中的表達式 `+o`。 [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_Absolute`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o*)*Return value: New reference.*返回 ”o“ 的絕對值,如果失敗,返回 *NULL*。等價于Python中的表達式 `abs(o)`。 [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_Invert`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o*)*Return value: New reference.*返回 *o* 的按位取反后的結果,如果失敗,返回 *NULL* 。等價于Python中的表達式 `~o`。 [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_Lshift`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o1*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*o2*)*Return value: New reference.*返回 *o1* 左移 *o2* 個比特后的結果,如果失敗,返回 *NULL* 。等價于Python中的表達式 `o1 << o2`。 [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_Rshift`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o1*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*o2*)*Return value: New reference.*返回 *o1* 右移 *o2* 個比特后的結果,如果失敗,返回 *NULL* 。等價于Python中的表達式 `o1 >> o2`。 [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_And`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o1*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*o2*)*Return value: New reference.*返回 *o1* 和 *o2* “按位與”的結果,如果失敗,返回 *NULL* 。等價于Python中的表達式 `o1 & o2`。 [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_Xor`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o1*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*o2*)*Return value: New reference.*返回 *o1* 和 *o2* “按位異或”的結果,如果失敗,返回 *NULL* 。等價于Python中的表達式 `o1 ^ o2`。 [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_Or`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o1*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*o2*)*Return value: New reference.*返回 *o1* 和 *o2* “按位或”的結果,如果失敗,返回 *NULL* 。等價于Python中的表達式 `o1 | o2` [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_InPlaceAdd`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o1*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*o2*)*Return value: New reference.*返回 *o1* 、*o2\*相加的結果,如果失敗,返回 \*NULL* 。當 *o1* 支持時,這個運算將完成后的值賦給 *o1*。 等價于Python中的語句 `o1 += o2`。 [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_InPlaceSubtract`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o1*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*o2*)*Return value: New reference.*返回 *o1* 減去 *o2\*的結果,如果失敗,返回 \*NULL* 。當 *o1* 支持時,這個運算將完成后的值賦給 *o1* 。 等價于Python中的語句 `o1 -= o2`。 [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_InPlaceMultiply`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o1*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*o2*)*Return value: New reference.*返回 *o1* 、*o2\*相乘的結果,如果失敗,返回 \*NULL* 。當 *o1* 支持時,這個運算將完成后的值賦給 *o1*。 等價于Python中的語句 `o1 *= o2`。 [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_InPlaceMatrixMultiply`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o1*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*o2*)*Return value: New reference.*返回 *o1* 、*o2\*做矩陣乘法后的結果,如果失敗,返回 \*NULL* 。當 *o1* 支持時,這個運算將完成后的值賦給 *o1*。 等價于Python中的語句 `o1 @= o2`。 3\.5 新版功能. [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_InPlaceFloorDivide`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o1*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*o2*)*Return value: New reference.*返回 *o1* 除以 *o2* 后向下取整的結果,如果失敗,返回 *NULL* 。當 *o1* 支持時,這個運算將完成后的值賦給 *o1*。 等價于Python中的語句 `o1 //= o2`。 [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_InPlaceTrueDivide`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o1*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*o2*)*Return value: New reference.*返回 *o1* 除以 *o2* 的一個合理的近似值,如果失敗,返回 *NULL*。這個值是近似的是因為二進制浮點數是一個近似值,它不可能表示出以2為基數的所有實數。這個函數返回兩個整數相除得到的浮點數。當 *o1* 支持時,這個運算將完成后的值賦給 *o1*. [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_InPlaceRemainder`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o1*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*o2*)*Return value: New reference.*返回 *o1* 除以 *o2* 得到的余數,如果失敗,返回 *NULL* 。當 *o1* 支持時,這個運算將完成后的值賦給 *o1*。 等價于Python中的語句 `o1 %= o2`。 [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_InPlacePower`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o1*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*o2*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*o3*)*Return value: New reference.*請參閱內置函數 [`pow()`](../library/functions.xhtml#pow "pow")。 如果失敗,返回 *NULL*。當 *o1* 支持時,這個運算將完成后的值賦給 *o1*。等價價于 Python 中的表達式 `pow(o1, o2, o3)`,其中 *o3* 是可選的。如果缺少 *o3*,則傳入 [`Py_None`](none.xhtml#c.Py_None "Py_None") 作為代替(如果傳入 *NULL* 會導致非法內存訪問)。如果 *o3* 是 [`Py_None`](none.xhtml#c.Py_None "Py_None") , 則該函數等價于 Python 中的語句 `o1 **= o2` 。 [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_InPlaceLshift`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o1*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*o2*)*Return value: New reference.*返回 *o1* 左移 *o2* 個比特后的結果,如果失敗,返回 *NULL* 。當 *o1* 支持時,這個運算將完成后的值賦給 *o1*。 等價于Python中的語句 `o1 <<= o2`。 [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_InPlaceRshift`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o1*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*o2*)*Return value: New reference.*返回 *o1* 右移 *o2* 個比特后的結果,如果失敗,返回 *NULL* 。當 *o1* 支持時,這個運算將完成后的值賦給 *o1*。 等價于Python中的語句 `o1 >>= o2`。 [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_InPlaceAnd`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o1*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*o2*)*Return value: New reference.*返回 *o1* 和 *o2* “按位與” 的結果,如果失敗,返回 *NULL* 。當 *o1* 支持時,這個運算將完成后的值賦給 *o1*。 等價于Python中的語句 `o1 &= o2` [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_InPlaceXor`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o1*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*o2*)*Return value: New reference.*返回 *o1* 和 *o2* “按位異或” 的結果,如果失敗,返回 *NULL* 。當 *o1* 支持時,這個運算將完成后的值賦給 *o1*。 等價于Python中的語句 `o1 ^= o2` [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_InPlaceOr`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o1*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*o2*)*Return value: New reference.*返回 *o1* 和 *o2* “按位或” 的結果,如果失敗,返回 *NULL* 。當 *o1* 支持時,這個運算將完成后的值賦給 *o1*。 等價于Python中的語句 `o1 |= o2` [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_Long`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o*)*Return value: New reference.*返回 *o* 轉換成整數類型的對象后的結果,如果失敗,返回 *NULL* 。等價于Python中的表達式 `int(o)`。 [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_Float`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o*)*Return value: New reference.*返回 *o* 轉換成浮點數類型的對象后的結果,如果失敗,返回 *NULL*。等價于Python中的表達式 `float(o)`。 [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_Index`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o*)*Return value: New reference.*返回 *o* 轉換為 Python 中的整數 *int* 類型后的結果,如果失敗,返回 *NULL* 并且引發 [`TypeError`](../library/exceptions.xhtml#TypeError "TypeError") 異常 [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyNumber_ToBase`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*n*, int *base*)*Return value: New reference.*返回整數 *n* 轉換成以 *base* 為基數的字符串后的結果。這個 *base* 參數必須是 2,8,10 或者 16 。對于基數 2,8,或 16 ,返回的字符串將分別加上基數標識 `'0b'`, `'0o'`, or `'0x'`。如果 *n* 不是 Python 中的整數 *int* 類型,就先通過 [`PyNumber_Index()`](#c.PyNumber_Index "PyNumber_Index") 將它轉換成整數類型。 Py\_ssize\_t `PyNumber_AsSsize_t`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*exc*)如果 *o* 是一個整數類型的解釋型,返回 *o* 轉換成一個 Py\_ssize\_t 值項后的結果。如果調用失敗,返回 `-1` 并引發異常。 如果 *o* 可以被轉換成 Python 中的整數 *int* 類型但是如果試圖轉換成一個 Py\_ssize\_t 值項則引發 [`OverflowError`](../library/exceptions.xhtml#OverflowError "OverflowError") ,同時 *exc* 參數是引發這個異常的類型(一般是 [`IndexError`](../library/exceptions.xhtml#IndexError "IndexError") 或者 [`OverflowError`](../library/exceptions.xhtml#OverflowError "OverflowError"))。如果 *exc* 是 *NULL*,那么這個異常被清除,同時,如果這個值項是正整數則它被省略成 *PY\_SSIZE\_T\_MIN*, 如果是負數則被省略成 *PY\_SSIZE\_T\_MAX* 。 int `PyIndex_Check`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o*)如果 *o* 是一個索引整數(存有 nb\_index 位置并有 tp\_as\_number 填入其中)則返回 `1`,否則返回 `0` 。這個函數不會調用失敗。 ### 導航 - [索引](../genindex.xhtml "總目錄") - [模塊](../py-modindex.xhtml "Python 模塊索引") | - [下一頁](sequence.xhtml "Sequence Protocol") | - [上一頁](object.xhtml "Object Protocol") | - ![](https://box.kancloud.cn/a721fc7ec672275e257bbbfde49a4d4e_16x16.png) - [Python](https://www.python.org/) ? - zh\_CN 3.7.3 [文檔](../index.xhtml) ? - [Python/C API 參考手冊](index.xhtml) ? - [抽象對象層](abstract.xhtml) ? - $('.inline-search').show(0); | ? [版權所有](../copyright.xhtml) 2001-2019, Python Software Foundation. Python 軟件基金會是一個非盈利組織。 [請捐助。](https://www.python.org/psf/donations/) 最后更新于 5月 21, 2019. [發現了問題](../bugs.xhtml)? 使用[Sphinx](http://sphinx.pocoo.org/)1.8.4 創建。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看