per page, with , order by , clip by
Results of 1 - 10 of about 49 for integer (0.007 sec.)
fractions --- 有理数 12859
fractions --- 有理数 ソースコード: Lib/fractions.py fractions モジュールは有理数の演算をサポートします。 Fraction インスタンスは、2 つの有理数、1 つの数値、または文字列から作成できます。 class fractions. Fraction ( numerator = 0 , denominat ... or がゼロの場合は ZeroDivisionError を送出します。 2 番目の形式では number が numbers.Rational のインスタンスであるか、 as_integer_ratio() メソッドを持つ必要があります ( float と decimal.Decimal はこれに含まれます)。 まったく同じ値を持つ Fraction インス ... タンスを返します。 as_integer_ratio() メソッドは互いに素な整数のペアを返し、後者が正であることを前提としています。 二進浮動小数点に伴う一般的な問題 ( 浮 ... 置、符号の処理、最小幅、桁のグループ化をサポートするようになりました。 バージョン 3.14 で変更: Fraction コンストラクタが as_integer_ratio() メソッドを持つ任意のオブジェクトを受け取れるようになりました。 numerator 有理数を既約分数で表したときの分子。 deno ...
https://man.mtool.work/python/3.14/library/fractions.html
math --- 数学関数 12119
math --- 数学関数 このモジュールは、C 標準で定義されたものを含む、一般的な数学関数と定数を提供します。 これらの関数で複素数を使うことはできません。複素数に対応する必要があるならば、 cmath モジュールにある同じ名前の関数を使ってください。ほと ... ます。 Number-theoretic functions comb(n, k) n 個から k 個を、重複なく順序を付けずに選ぶ方法の数 factorial(n) n の階乗 gcd(*integers) 整数引数の最大公約数 isqrt(n) 非負整数 n の整数平方根 lcm(*integers) 整数引数の最小公倍数 perm(n, k) n 個から k 個を、重 ... to the coefficient of k-th term in polynomial expansion of (1 + x)ⁿ . Raises TypeError if either of the arguments are not integers. Raises ValueError if either of the arguments are negative. Added in version 3.8. math. factorial ( n ) Return factorial ... of the nonnegative integer n . バージョン 3.10 で変更: Floats with integral values (like 5.0 ) are no longer accepted. math. gcd ( * integers ) Retur ...
https://man.mtool.work/python/3.14/library/math.html
引数の解釈と値の構築 10610
引数の解釈と値の構築 これらの関数は、独自の拡張関数やメソッドを作成するときに便利です。 追加の情報や例は Python インタプリタの拡張と埋め込み を参照してください。 最初に説明する 3 つの関数、 PyArg_ParseTuple() , PyArg_ParseTupleAndKeywords() ... 殊メソッド __index__() 、 __float__() 、 __complex__() で Python オブジェクトを必要な型に変換することもできます。 For signed integer formats, OverflowError is raised if the value is out of range for the C type. For unsigned integer formats, no range check ... でない Python 整数を小さい符号なし整数に変換し、C の unsigned char に格納します。 B ( int ) [unsigned char] Convert a Python integer to a tiny integer without overflow checking, stored in a C unsigned char . h ( int ) [short int] Python の整数を、 C の sh ... ort int 型に変換します。 H ( int ) [unsigned short int] Convert a Python integer to a C unsigned short int , without overflow checking. i ( int ) [int] Python の整数を、 C の int 型に変換します。 I ( int ...
https://man.mtool.work/python/3.14/c-api/arg.html
ctypes --- Python 用の外部関数ライブラリ 10610
ctypes --- Python 用の外部関数ライブラリ ソースコード: Lib/ctypes ctypes は Python 用の外部関数ライブラリです。 C と互換性のあるデータ型を提供し、DLL や共有ライブラリの関数を呼び出せます。 これらのライブラリを純粋な Python でラップするために ... "def" ) Traceback (most recent call last): ctypes.ArgumentError : argument 2: TypeError: one character bytes, bytearray or integer expected >>> print ( strchr ( b "abcdef" , b "x" )) None >>> strchr ( b "abcdef" , b "d" ) b'def' >>> 外部関数が整数を返す ... 。配列の要素がゼロで初期化されているためです。 正しい型の初期化子を指定することもできます。: >>> from ctypes import * >>> TenIntegers = c_int * 10 >>> ii = TenIntegers ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ) >>> print ( ii ) <c_long_Array_10 object at ... は行われません。 class ctypes. c_ulonglong Represents the C unsigned long long datatype. The constructor accepts an optional integer initializer; no overflow checking is done. On platforms where sizeof(long long) == sizeof(long) it is an alias to c_ulong ...
https://man.mtool.work/python/3.14/library/ctypes.html
uuid --- RFC 9562 に基づく UUID オブジェクト 10368
uuid --- RFC 9562 に基づく UUID オブジェクト ソースコード: Lib/uuid.py このモジュールは、イミュータブルな UUID オブジェクト ( UUID クラス) と、 RFC 9562 ( RFC 4122 を置き換える RFC) で規定された特定のバージョンの UUID を生成する 関数 を提供 ... 刻から UUID を生成します。 When node is not specified, getnode() is used to obtain the hardware address as a 48-bit positive integer. When a sequence number clock_seq is not specified, a pseudo-random 14-bit positive integer is generated. node または cloc ... の、 uuid1() の代替です。 When node is not specified, getnode() is used to obtain the hardware address as a 48-bit positive integer. When a sequence number clock_seq is not specified, a pseudo-random 14-bit positive integer is generated. node または cloc ... C 9562, §5.8 に従い、疑似乱数の UUID を生成します。 When specified, the parameters a , b and c are expected to be positive integers of 48, 12 and 62 bits respectively. If they exceed their expected bit count, only their least significant bits are kept; ...
https://man.mtool.work/python/3.14/library/uuid.html
組み込み型 8859
組み込み型 以下のセクションでは、インタプリタに組み込まれている標準型について記述します。 主要な組み込み型は、数値、シーケンス、マッピング、クラス、インスタンス、および例外です。 コレクションクラスには、ミュータブルなものがあります。コレクシ ... ttle_ordered ) return n Added in version 3.2. バージョン 3.11 で変更: byteorder 引数にデフォルト値を追加しました。 int. as_integer_ratio ( ) 比が元の数と等しくなるような整数のペアを返します。戻り値の分母に相当する数は正の整数です。元の数が整数の場合の比 ... は、常にその整数が分子であり、分母は 1 です。 Added in version 3.8. int. is_integer ( ) 常に True を返します。 float.is_integer() に対するダックタイピングの互換性のために存在しています。 Added in version 3. ... に委譲します。 __float__() が定義されていない場合、 __index__() へフォールバックします。 Added in version 3.14. float. as_integer_ratio ( ) 比が厳密に元の浮動小数点数であるような一対の整数を返します。比は既約分数として与えられ、分母は正の値です。無限大 ...
https://man.mtool.work/python/3.14/builtins/stdtypes.html
15. 浮動小数点演算、その問題と制限 8617
15. 浮動小数点演算、その問題と制限 浮動小数点数は、コンピューターのハードウェア上では 2 進小数で表されます。 例えば、 10 進小数 の 0.625 は 6/10 + 2/100 + 5/1000 という値を持ち、同様に 2 進小数 の 0.101 は 1/2 + 0/4 + 1/8 という値を持ちます ... してください。 浮動小数点数の正確な値を 本当に 知りたいというまれな場合に役立つツールも、Python は提供しています。 float.as_integer_ratio() メソッドは、浮動小数点数の値を分数として表します: >>> x = 3.14159 >>> x . as_integer_ratio () (3537115888337719, 1 ... fractions import Fraction >>> Fraction . from_float ( 0.1 ) Fraction(3602879701896397, 36028797018963968) >>> ( 0.1 ) . as_integer_ratio () (3602879701896397, 36028797018963968) >>> Decimal . from_float ( 0.1 ) Decimal('0.1000000000000000055511151231257 ...
https://man.mtool.work/python/3.14/tutorial/floatingpoint.html
はじめに 8361
はじめに Python のアプリケーションプログラマー向けインターフェース (API) は、C と C++ のプログラマーに、Python インタープリタへのさまざまなレベルのアクセスを提供します。 C++ からも同様に使えますが、簡潔に Python/C API と呼びます。 Python/C ... MAX は、おおむね ((( x ) > ( y )) ? ( x ) : ( y )) に相当します。 Added in version 3.3. Py_ARITHMETIC_RIGHT_SHIFT ( type , integer , positions ) integer >> positions と似ていますが、必ず符号拡張を行います。 C の規格では、符号付き整数の右シフトで符号拡張 ... を行うか、ゼロで埋めるかが定められていないためです。 integer は任意の符号付き整数型の値を指定します。 positions は右にシフトするビット数です。 integer と positions は、どちらも複数回評 ... ださい。 代わりに、結果を変数に保存してから渡してください。 type は使われず、後方互換性のためだけに残されています。 以前は、 integer のキャストに使っていました。 バージョン 3.1 で変更: unsigned type が有効な型だけでなく、すべての符号付き整数型で使えるよう ...
https://man.mtool.work/python/3.14/c-api/intro.html
random --- 疑似乱数を生成する 8361
random --- 疑似乱数を生成する ソースコード: Lib/random.py このモジュールでは様々な分布をもつ擬似乱数生成器を実装しています。 整数用に、ある範囲からの一様な選択があります。 シーケンス用には、シーケンスからのランダムな要素の一様な選択、リスト ... ights or cum_weights can use any numeric type that interoperates with the float values returned by random() (that includes integers, floats, and fractions but excludes decimals). Weights are assumed to be non-negative and finite. A ValueError is raised ... 終了します。 -c CHOICE [CHOICE ...] --choice CHOICE [CHOICE ...] choice() を使用してランダムに選択して出力します。 -i <N> --integer <N> randint() を使用して1からNの間(Nを含む)のランダムな整数を出力します。 -f <N> --float <N> uniform() を使用して0からNの間 ... 動小数点数を出力します。 オプションが指定されない場合、出力は入力に依存します。 文字列または複数: --choice と同じ。 整数: --integer と同じ。 浮動小数点数: --float と同じ。 コマンドラインの例 以下は random のコマンドラインインターフェースの例です: $ # ラン ...
https://man.mtool.work/python/3.14/library/random.html
GDB による C API 拡張と CPython 内部のデバッグ 8119
GDB による C API 拡張と CPython 内部のデバッグ このドキュメントでは、Python の GDB 拡張 python-gdb.py を GDB デバッガと組み合わせて、CPython 拡張や CPython インタープリタ自体をデバッグする方法を説明します。 クラッシュやデッドロックなどの低レ ... t ( PyLongObject * ) のプリティプリンタによる表示は、通常の機械レベルの整数の表示と区別がつきません。 (gdb) p some_machine_integer $3 = 42 (gdb) p some_python_integer $4 = 42 PyLongObject * にキャストすると内部構造を確認できます。 (gdb) p *(PyLongObject ... *)some_python_integer $5 = {ob_base = {ob_base = {ob_refcnt = 8, ob_type = 0x3dad39f5e0}, ob_size = 1}, ob_digit = {42}} str 型でも、GDB 組み込み ...
https://man.mtool.work/python/3.14/howto/gdb_helpers.html
PREV 1 2 3 4 5 NEXT