リンクを新しいタブで開く
  1. Pythonで算数・数学の問題を解く | note.nkmk.me

    • 四則演算には +, -, *, /演算子を使う。そのほか、整数除算の//演算子、剰余(あまり, mod)の%演算子、べき乗の**演算子などがある。 1. 関連記事: Pythonの算術演算子(四則演算、べき乗、リスト・文字列 … さらに表示

    三角関数: Math …

    標準ライブラリのmathモジュールを使うと、三角関数(sin, cos, tan)、逆三角関数(arcsin, arccos, arctan)を計算できる。角度変換(ラジアンと度)も可能。 1. 関連記事: Pythonで三角関数を計算(sin, cos, tan, arcsin, arccos, arctan)

    nkmk note
    指数関数・対数関数: Math …

    標準ライブラリのmathモジュールを使うと、指数関数および対数関数(自然対数、常用対数、二進対数)を計算できる。 1. 関連記事: Pythonで指数関数・対数関数を計算(exp, log, log10, log2)

    nkmk note
  1. Python provides a rich set of mathematical functions through its built-in math module. This module offers a variety of functions for performing mathematical operations, ranging from basic arithmetic to more complex calculations.

    Basic Mathematical Functions

    The math module includes several basic functions that are commonly used in mathematical computations:

    • math.ceil(x): Returns the smallest integer greater than or equal to x.

    • math.floor(x): Returns the largest integer less than or equal to x.

    • math.fabs(x): Returns the absolute value of x.

    • math.factorial(n): Returns the factorial of n.

    • math.sqrt(x): Returns the square root of x.

    Example:

    import math

    print(math.ceil(4.2)) # Output: 5
    print(math.floor(4.8)) # Output: 4
    print(math.fabs(-7.25)) # Output: 7.25
    print(math.factorial(5)) # Output: 120
    print(math.sqrt(16)) # Output: 4.0
    コピーしました。

    Trigonometric Functions

    The math module also provides functions for trigonometric calculations:

    フィードバック
    ありがとうございました!詳細をお聞かせください
    1. Python_mathライブラリで使用頻度が高い標準メソッド10選 - Qiita

      2024年12月28日 · Python_mathライブラリで使用頻度が高い標準メソッド10選 用途: 数値計算、数学 …

      欠落単語:
      • Tutorial
      次が必須:
    2. 【Python入門】よく使うmath-数学関数の使い方まとめ | 侍 ...

      2024年5月6日 · Pythonのmathモジュールは、数学の知識がなくても複雑な計算を簡単に行える便利 …

    3. Python入門:mathモジュールで基本の数学関数を使い …

      2025年4月30日 · Pythonには標準でさまざまな数学関数を提供するmathモジュールがあります。 四捨五入や平方根、階乗、三角関数、対数など、日常的 …

    4. Python import mathの完全ガイド:数学関数の使い方を徹底解説

      2025年7月29日 · Python import mathの完全ガイド:数学関数の使い方を徹底解説 Pythonで数学的な …

    5. Pythonのmathモジュール入門:円周率 (pi)やネイピア …

      2025年12月2日 · Pythonの標準ライブラリである math モジュール を使用すると、これらの定数を高精度で利用できるほか、平方根や三角関数などの高度な数学 …

    6. Pythonでmathモジュールを使うためのpipインストール …

      2023年11月11日 · Pythonのmathモジュールについて Pythonには標準でmathというモジュールが用意されています。 このモジュールには数学関数がたくさん …

    7. 【2026】Pythonからはじめる数学入門がおすすめな理 …

      2024年5月31日 · Pythonからはじめる数学入門は、Pythonを使って数学の基本的な概念を学ぶための入門書です。 具体的なコード例を通じて、数学の概念を理 …

    8. math — Mathematical functions — Python 3.14.3 …

      2026年3月26日 · This module provides access to common mathematical functions and constants, including those defined by the C standard. These functions …

    9. PythonのMathライブラリ: 数学的な力をコードで解き明 …

      2024年1月9日 · Pythonのmathライブラリは、数学的な計算を効率的に行うための強力なツールセットを提供します。 本記事では、mathライブラリの主要な機 …

このサイトを利用すると、分析、カスタマイズされたコンテンツ、広告に Cookie を使用することに同意したことになります。サード パーティの Cookie に関する詳細情報|Microsoft のプライバシー ポリシー