per page, with , order by , clip by
Results of 1 - 10 of about 27 for fractions (0.009 sec.)
fractions --- 有理数 16063
fractions --- 有理数 ソースコード: Lib/fractions.py fractions モジュールは有理数の演算をサポートします。 Fraction インスタンスは、2 つの有理数、1 つの数値、または文字列から作成できます。 class fractions. Fraction ( numerator = 0 , denominat ... or = 1 ) class fractions. Fraction ( number ) class fractions. Fraction ( string ) 最初の形式では numerator と denominator が numbers.Rational のイ ... 受け付けられます。どちらの形式でも、入力される文字列は前後に空白があって構いません。以下に、いくつかの例を示します: >>> from fractions import Fraction >>> Fraction ( 16 , - 10 ) Fraction(-8, 5) >>> Fraction ( 123 ) Fraction(123, 1) >>> Fraction () Fraction( ... に最も近い Fraction を見付けて返します。このメソッドは与えられた浮動小数点数の有理数近似を見つけるのに役立ちます: >>> from fractions import Fraction >>> Fraction ( '3.1415926535897932' ) . limit_denominator ( 1000 ) Fraction(355, 113) あるいは float で表さ ...
https://man.mtool.work/python/3.14/library/fractions.html
15. 浮動小数点演算、その問題と制限 9512
15. 浮動小数点演算、その問題と制限 浮動小数点数は、コンピューターのハードウェア上では 2 進小数で表されます。 例えば、 10 進小数 の 0.625 は 6/10 + 2/100 + 5/1000 という値を持ち、同様に 2 進小数 の 0.101 は 1/2 + 0/4 + 1/8 という値を持ちます ... プリケーションや高精度の計算が求められるアプリケーションに適した、10進数の計算を実装しています。 別の正確な計算方法として、 fractions モジュールが有理数に基づく計算を実装しています (1/3 のような数を正確に表すことができます)。 浮動小数点演算を頻繁に使う場合 ... は、全ての桁を 10 進数で表示する代わりに、結果を有効数字 17 桁に丸めます: >>> format ( 0.1 , '.17f' ) '0.10000000000000001' fractions モジュールと decimal モジュールを使うとこれらの計算を簡単に行えます: >>> from decimal import Decimal >>> from fractions im ...
https://man.mtool.work/python/3.14/tutorial/floatingpoint.html
数値と数学モジュール 9084
数値と数学モジュール この章で記述されているモジュールは、数値に関するあるいは数学関係の関数とデータ型を提供します。 numbers モジュールは、数値の型の抽象的な階層を定義します。 math と cmath モジュールは、浮動小数点数と複素数のための様々な数学 ... 丸めモード シグナル 浮動小数点に関する注意点 精度を上げて丸め誤差を抑制する 特殊値 スレッドを使った処理 レシピ Decimal FAQ fractions --- 有理数 random --- 疑似乱数を生成する 保守 (bookkeeping) 関数 バイト列用の関数 整数用の関数 シーケンス用の関数 離散分布 ...
https://man.mtool.work/python/3.14/library/numeric.html
Python ドキュメントの目次 8870
Python ドキュメントの目次 What's New in Python What's new in Python 3.14 概要 -- リリースハイライト 新しい機能 PEP 649 と PEP 749 : アノテーションの遅延評価 PEP 734 : 複数インタープリタ機能が標準ライブラリに追加 PEP 750 : テンプレート文字列 ... calendar concurrent.futures configparser contextvars ctypes curses datetime decimal difflib dis errno faulthandler fnmatch fractions functools getopt getpass graphlib heapq hmac http imaplib inspect io json linecache logging.handlers math mimetypes multip ... ジュール argparse array ast asyncio base64 compileall concurrent.futures configparser copy ctypes dbm dis doctest email enum fractions glob importlib io ipaddress itertools marshal math mimetypes mmap multiprocessing os os.path pathlib pdb queue random re s ... 静的型付けのための override デコレータ その他の言語変更 新たなモジュール 改良されたモジュール array asyncio calendar csv dis fractions importlib.resources inspect itertools math os os.path pathlib platform pdb random shutil sqlite3 statistics sys tempfile t ...
https://man.mtool.work/python/3.14/contents.html
組み込み型 8673
組み込み型 以下のセクションでは、インタプリタに組み込まれている標準型について記述します。 主要な組み込み型は、数値、シーケンス、マッピング、クラス、インスタンス、および例外です。 コレクションクラスには、ミュータブルなものがあります。コレクシ ... z から実部および虚部を取り出すには、 z.real および z.imag を使ってください。 (標準ライブラリには、さらに分数のための数値型 fractions.Fraction や、ユーザによる精度の定義が可能な浮動小数点数のための decimal.Decimal があります。) 数値は、数値リテラルによって ... 詳細は __hash__() メソッドドキュメントを参照してください)。実装の簡単さと 複数の数値型 ( int 、 float 、 decimal.Decimal 、 fractions.Fraction を含みます) 間の効率のため、Python の 数値型に対するハッシュ値はある単一の数学的関数に基づいていて、 その関数はす ... べての有理数に対し定義されているため、 int と fractions.Fraction のすべてのインスタンスと、 float と decimal.Decimal のすべての有限なインスタンスに 対して適用されます。本質的には ...
https://man.mtool.work/python/3.14/builtins/stdtypes.html
statistics --- 数学的統計関数 8459
statistics --- 数学的統計関数 Added in version 3.4. ソースコード: Lib/statistics.py このモジュールは、数値 ( Real 型) データを数学的に統計計算するための関数を提供します。 このモジュールは、 NumPy , SciPy のような third-party ライブラリや、M ... sError を送出します。 使用例: >>> mean ([ 1 , 2 , 3 , 4 , 4 ]) 2.8 >>> mean ([ - 1.0 , 2.5 , 3.25 , 5.75 ]) 2.625 >>> from fractions import Fraction as F >>> mean ([ F ( 3 , 7 ), F ( 1 , 21 ), F ( 5 , 3 ), F ( 1 , 3 )]) Fraction(13, 21) >>> from decimal i ... as D >>> pvariance ([ D ( "27.5" ), D ( "30.25" ), D ( "30.25" ), D ( "34.5" ), D ( "41.75" )]) Decimal('24.815') >>> from fractions import Fraction as F >>> pvariance ([ F ( 1 , 4 ), F ( 5 , 4 ), F ( 1 , 2 )]) Fraction(13, 72) 注釈 母集団全体で呼んだ場合 ... s D >>> variance ([ D ( "27.5" ), D ( "30.25" ), D ( "30.25" ), D ( "34.5" ), D ( "41.75" )]) Decimal('31.01875') >>> from fractions import Fraction as F >>> variance ([ F ( 1 , 6 ), F ( 1 , 2 ), F ( 5 , 3 )]) Fraction(67, 108) 注釈 Bessel 補正済みの標本分 ...
https://man.mtool.work/python/3.14/library/statistics.html
What's New in Python 2.6 8459
What's New in Python 2.6 著者 : A.M. Kuchling (amk at amk.ca) この記事では、2008 年 10 月 1 日にリリースされた Python 2.6 の新機能を説明します。 リリース日程は PEP 361 に記載されています。 Python 2.6 の主要なテーマは、言語を大幅に再設計する ... 較です。 Rational は Real を継承し、 numerator と denominator プロパティを持ち、浮動小数点数へ変換できます。 Python 2.6 では fractions モジュールに、単純な有理数クラス Fraction が加わりました。 ( numbers.Rational との名前の衝突を避けるため、 Rational ではな ... の型階層 PEP 著: Jeffrey Yasskin. Guile マニュアルの Scheme's numerical tower 。 R5RS Scheme 仕様の Scheme の数値データ型 。 fractions モジュール 数値型階層を埋めるべく、 fractions モジュールが有理数クラスを提供しています。有理数は分子(numerator)と分母(deno ... な数を正確に表現出来ます。 Fraction のコンストラクターは、分数の分子と分母になる 2 つの Integral 値を受け取ります。 >>> from fractions import Fraction >>> a = Fraction ( 2 , 3 ) >>> b = Fraction ( 2 , 5 ) >>> float ( a ), float ( b ) (0.66666666666666663, 0 ...
https://man.mtool.work/python/3.14/whatsnew/2.6.html
numbers --- 数の抽象基底クラス 8245
numbers --- 数の抽象基底クラス ソースコード: Lib/numbers.py numbers モジュール ( PEP 3141 ) は、下位になるほど多くの演算を定義する、数値の 抽象基底クラス の階層を定義しています。 このモジュールで定義する型は、どれもインスタンス化を目的とした ... 演算の多くは似た形になるので、演算子ごとに通常の演算と反射演算のメソッドを生成するヘルパー関数を定義すると便利です。 例えば fractions.Fraction では、次のようにしています。 def _operator_fallbacks ( monomorphic_operator , fallback_operator ): def forward ( ...
https://man.mtool.work/python/3.14/library/numbers.html
threading --- スレッドベースの並列処理 8245
threading --- スレッドベースの並列処理 ソースコード: Lib/threading.py このモジュールでは、高水準のスレッドインターフェースをより低水準 な _thread モジュールの上に構築しています。 利用可能な環境 : not WASI. このモジュールは WebAssembly では動 ... ument is present and not None , it should be a floating-point number specifying a timeout for the operation in seconds (or fractions thereof). As join() always returns None , you must call is_alive() after join() to decide whether a timeout happened -- if ... ument is present and not None , it should be a floating-point number specifying a timeout for the operation in seconds (or fractions thereof). 根底にあるロックが RLock である場合、 release() メソッドではロックは解放されません。というのも、ロックが再帰的に ... ument is present and not None , it should be a floating-point number specifying a timeout for the operation in seconds, or fractions thereof. バージョン 3.1 で変更: 以前は、このメソッドは常に None を返していました。 Timer オブジェクト このクラスは、一定時 ...
https://man.mtool.work/python/3.14/library/threading.html
What's New In Python 3.2 8245
What's New In Python 3.2 著者 : Raymond Hettinger この記事では Python 3.1 と比較した Python 3.2 の新機能を説明します。 Python 3.2 は 2011 年 2 月 20 日にリリースされました。 主な変更点をいくつか取り上げ、例を示します。 すべての詳細については ... ント本体で使えるロギングのインスタンスを返す綺麗な方法はありません。 (Contributed by Michael Foord in bpo-9110 .) decimal と fractions Mark Dickinson は、異なる数値データの型が実際の値が等しい場合は常に同じハッシュ値を持つことを保証する、エレガントで効率的な ... 使う必要はなくなりました ( bpo-8257 )。 型違いの比較はいまでは完全にサポートされたので、 Decimal オブジェクトを直接 float や fractions.Fraction と比較出来ます ( bpo-2531 and bpo-8188 )。 fractions.Fraction にも同様の変更が加えられ、 from_float() と from_dec ... imal() は不要になりました ( bpo-8294 )。 >>> from decimal import Decimal >>> from fractions import Fraction >>> Decimal ( 1.1 ) Decimal('1.100000000000000088817841970012523233890533447265625') >>> Fraction ( 1.1 ) ...
https://man.mtool.work/python/3.14/whatsnew/3.2.html
PREV 1 2 3 NEXT