# From jupyter notebook
import sympy
sympy.init_printing()
x1 = sympy.Rational(1, 2)
x2 = sympy.sqrt(2)
# ERROR: can't do this..
x3 = sympy.Rational(1, sympy.sqrt(2))
# ERROR: can't do this either
x4 = sympy.Rational(1, x2)
如何在不使用浮点数的情况下将sqrt符号化地放入方程的分母中?你知道吗
当您需要1/sqrt(2)时,请执行以下操作:
当您需要1/2时,请执行以下操作:
不要这样做:
错误。你知道吗
相关问题 更多 >
编程相关推荐