per page, with , order by , clip by
Results of 1 - 10 of about 18 for imag (0.006 sec.)
複素数オブジェクト 12817
複素数オブジェクト Python's complex number objects are implemented as two distinct types when viewed from the C API: one is the Python object exposed to Python programs, and the other is a C structure which represents the actual complex num ... ling with complex number objects use structures of this type as input or output values, as appropriate. double real double imag 構造体は次のように定義されています。 typedef struct { double real ; double imag ; } Py_complex ; Py_complex _Py_c_sum ( Py ... ェクトを作成します。 エラーの場合は例外を設定して NULL を返します。 PyObject * PyComplex_FromDoubles ( double real , double imag ) 戻り値: 新しい参照。 次に属します: Stable ABI . real と imag から新しい PyComplexObject オブジェクトを作成して返します。 ... rred() を呼び出してください。 バージョン 3.13 で変更: 利用可能なら __complex__() を使うようになりました。 double PyComplex_ImagAsDouble ( PyObject * op ) 次に属します: Stable ABI . op の虚数部分を C の double 型で返します。 op が Python の複素数オブジ ...
https://man.mtool.work/python/3.14/c-api/complex.html
cmath --- 複素数用の数学関数 11084
cmath --- 複素数用の数学関数 このモジュールは、複素数を扱う数学関数へのアクセスを提供しています。 このモジュール中の関数は整数、浮動小数点数または複素数を引数にとります。 また、 __complex__() または __float__() どちらかのメソッドを提供してい ... 虚部が NaN の純虚数 極座標変換 Python の複素数 z は、内部では 直交座標 (デカルト座標) で保持されます。 実部 z.real と 虚部 z.imag によって完全に定まります。 極座標 は複素数を表現する別の方法です。極座標では、複素数 z は半径 r と位相角 phi で定義されます ... 逆を行うのに使えます。 cmath. phase ( z ) z の位相 ( 偏角 とも呼びます) を浮動小数点数で返します。 phase(z) は math.atan2(z.imag, z.real) と同じです。 結果の範囲は [- π , π ] で、分枝切断は負の実軸に沿っています。 z.imag がゼロの場合も、結果の符号は z ... .imag の符号と同じです。 >>> phase ( - 1 + 0 j ) 3.141592653589793 >>> phase ( - 1 - 0 j ) -3.141592653589793 注釈 複素数 z の大 ...
https://man.mtool.work/python/3.14/library/cmath.html
numbers --- 数の抽象基底クラス 10844
numbers --- 数の抽象基底クラス ソースコード: Lib/numbers.py numbers モジュール ( PEP 3141 ) は、下位になるほど多くの演算を定義する、数値の 抽象基底クラス の階層を定義しています。 このモジュールで定義する型は、どれもインスタンス化を目的とした ... のサブクラスは複素数を表し、組み込みの complex 型を受け付ける演算を含みます。それらは: complex および bool への変換、 real , imag , + , - , * , / , ** , abs() , conjugate() , == , != です。 - と != 以外の全てのものは抽象メソッドや抽象プロパティです。 r ... eal 抽象プロパティ。この数の実部を取り出します。 imag 抽象プロパティ。この数の虚部を取り出します。 abstractmethod conjugate ( ) 抽象メソッド。 複素共役を返します。 たとえば、 ( ... () , round() , math.floor() , math.ceil() , divmod() , // , % , < , <= , > および >= です。 Real はまた complex() , real , imag および conjugate() のデフォルトを提供します。 class numbers. Rational Real をサブタイプ化し numerator と denominator のプロ ...
https://man.mtool.work/python/3.14/library/numbers.html
json --- JSON エンコーダーとデコーダー 10586
json --- JSON エンコーダーとデコーダー ソースコード: Lib/json/__init__.py JSON (JavaScript Object Notation) は、 RFC 7159 ( RFC 4627 を obsolete) と ECMA-404 によって定義された軽量のデータ交換用のフォーマットです。 JavaScript のオブジェクト ... > def custom_json ( obj ): ... if isinstance ( obj , complex ): ... return { '__complex__' : True , 'real' : obj . real , 'imag' : obj . imag } ... raise TypeError ( f 'Cannot serialize object of { type ( obj ) } ' ) ... >>> json . dumps ( 1 + 2 j , ... default = custom_json ) '{"__complex__": true, "real": 1.0, "imag": 2.0}' JSON のデコーディング: >>> import json >>> json . loads ( '["foo", {"bar":["baz", null, 1.0, 2]}]' ) ['foo', {'bar ... する: >>> import json >>> def as_complex ( dct ): ... if '__complex__' in dct : ... return complex ( dct [ 'real' ], dct [ 'imag' ]) ... return dct ... >>> json . loads ( '{"__complex__": true, "real": 1, "imag": 2}' , ... object_hook = as_complex ) ( ...
https://man.mtool.work/python/3.14/library/json.html
PyHash API 9848
PyHash API PyTypeObject.tp_hash メンバや 数値型のハッシュ化 も参照してください。 type Py_hash_t ハッシュ値型: 符号付き整数。 Added in version 3.2. type Py_uhash_t ハッシュ値型: 符号なし整数。 Added in version 3.2. Py_HASH_ALGORITHM str 、 b ... ion 3.13. PyHASH_INF 正の無限大に対して返すハッシュ値。 sys.hash_info.inf 定数に対応します。 Added in version 3.13. PyHASH_IMAG 複素数の虚部に使う乗数。 sys.hash_info.imag 定数に対応します。 Added in version 3.13. type PyHash_FuncDef PyHash_GetFuncDe ...
https://man.mtool.work/python/3.14/c-api/hash.html
組み込み関数 9608
組み込み関数 Python インタプリタには数多くの関数と型が組み込まれており、いつでも利用できます。それらをここにアルファベット順に挙げます。 組み込み関数 A abs() aiter() all() anext() any() ascii() B bin() bool() breakpoint() bytearray() bytes( ... or が送出されるようになりました。 class complex ( number = 0 , / ) class complex ( string , / ) class complex ( real = 0 , imag = 0 ) 単一の文字列や数値を複素数に変換する、あるいは実部と虚部から複素数を作成します。 例: >>> complex ( '+1.23' ) (1.23+0 ... -1.23+4.5J ) \n ' ) (-1.23+4.5j) >>> complex ( '-Infinity+NaNj' ) (-inf+nanj) >>> complex ( 1.23 ) (1.23+0j) >>> complex ( imag =- 4.5 ) -4.5j >>> complex ( - 1.23 , 4.5 ) (-1.23+4.5j) 引数が文字列の場合、実数部( float() と同じ形式)、虚数部(同様の ... 引数が使われている場合、各引数は任意の数値型(複素数を含む)となります。両方の引数が実数の場合には、実数成分 real と虚数成分 imag を持つ複素数を返します。引数が両方とも複素数の場合、実数成分 real.real-imag.imag と虚数成分 real.imag+imag.real を持つ複素 ...
https://man.mtool.work/python/3.14/builtins/functions.html
組み込み型 8356
組み込み型 以下のセクションでは、インタプリタに組み込まれている標準型について記述します。 主要な組み込み型は、数値、シーケンス、マッピング、クラス、インスタンス、および例外です。 コレクションクラスには、ミュータブルなものがあります。コレクシ ... 可能です。複素数は実部と虚部を持ち、それぞれが浮動小数点数です。複素数 z から実部および虚部を取り出すには、 z.real および z.imag を使ってください。 (標準ライブラリには、さらに分数のための数値型 fractions.Fraction や、ユーザによる精度の定義が可能な浮動 ... 値を (それぞれ) 表すのに使われます。 複素 ( complex ) 数 z に対して、実部と虚部のハッシュ値は、 hash(z.real) + sys.hash_info.imag * hash(z.imag) の 2**sys.hash_info.width を法とする還元を計算することにより組み合わせられ、よってこれは range(-2**(sys.has ... ()) def hash_complex ( z ): """複素数 z のハッシュを計算する。""" hash_value = hash_float ( z . real ) + sys . hash_info . imag * hash_float ( z . imag ) # 2**sys.hash_info.width を法として、符号付きの剰余に還元する M = 2 ** ( sys . hash_info . width ...
https://man.mtool.work/python/3.14/builtins/stdtypes.html
将来のバージョンで削除予定 8115
将来のバージョンで削除予定 以下の API は将来削除されますが、現時点では削除時期は決まっていません。 argparse : 引数グループの入れ子と、相互排他的なグループの入れ子は非推奨です。 add_argument_group() に、ドキュメント化されていないキーワード引 ... スを返すことへの対応:今後は complex 自体のインスタンスを返すことが必須になります。 complex() コンストラクターの real 引数や imag 引数に複素数を渡すことは非推奨になりました。 複素数は単独の位置引数としてのみ渡してください。 (Serhiy Storchaka が gh-1092 ...
https://man.mtool.work/python/3.14/deprecations/pending-removal-in-future.html
非推奨 7618
非推奨 Python 3.15 で削除予定 インポートシステム: Setting __cached__ on a module while failing to set __spec__.cached is deprecated. In Python 3.15, __cached__ will cease to be set or take into consideration by the import system or standard ... スを返すことへの対応:今後は complex 自体のインスタンスを返すことが必須になります。 complex() コンストラクターの real 引数や imag 引数に複素数を渡すことは非推奨になりました。 複素数は単独の位置引数としてのみ渡してください。 (Serhiy Storchaka が gh-1092 ...
https://man.mtool.work/python/3.14/deprecations/
用語集 7618
用語集 >>> 対話型 シェルにおけるデフォルトの Python プロンプトです。インタープリターで対話的に実行されるコード例でよく見られます。 ... 次のものが考えられます: 対話型 ( interactive ) シェルにおいて、インデントされたコードブロック、対応する左 ... た辞書の中の値として渡された引数。例えば、次の complex() の呼び出しでは、 3 と 5 がキーワード引数です: complex ( real = 3 , imag = 5 ) complex ( ** { 'real' : 3 , 'imag' : 5 }) 位置引数 : キーワード引数以外の引数。位置引数は引数リストの先頭に書くことが ...
https://man.mtool.work/python/3.14/glossary.html
PREV 1 2 NEXT