Created
May 6, 2018 01:41
-
-
Save devlights/83d02c809f82c20d462185d44b72b4c6 to your computer and use it in GitHub Desktop.
[python][sympy] python の sympy を使って分数指数計算
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sympy | |
# 指数部分を定義 (マイナス2分の1乗) | |
n = -sympy.Rational(1, 2) | |
print(n) | |
# 8のマイナス2分の1乗を求める | |
r = 8**n | |
print(r) # ==> sympy.sqrt(2)/4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment