回答編集履歴

3

些細

2022/12/05 03:29

投稿

quickquip
quickquip

スコア11051

test CHANGED
@@ -52,6 +52,9 @@
52
52
  ... x = 1/sympy.sqrt(2)
53
53
  >>> x == 1/sympy.sqrt(2)
54
54
  False
55
+
56
+ >>> x.equals(1/sympy.sqrt(2))
57
+ True
55
58
  ```
56
59
  ですよねー、という感じがしますね。
57
60
 

2

引用追加

2022/12/05 03:28

投稿

quickquip
quickquip

スコア11051

test CHANGED
@@ -1,4 +1,7 @@
1
1
  [https://stackoverflow.com/questions/48839611/disabling-automatic-simplification-in-sympy#answer-48847102](https://stackoverflow.com/questions/48839611/disabling-automatic-simplification-in-sympy#answer-48847102)
2
+ > A simpler way to disable automatic evaluation is to use context manager evaluate.
3
+
4
+ ただ
2
5
 
3
6
  > However, as the docstring of the context manager says, most of SymPy code expects automatic evaluation.
4
7
 

1

例を忘れてました

2022/12/05 03:27

投稿

quickquip
quickquip

スコア11051

test CHANGED
@@ -3,6 +3,13 @@
3
3
  > However, as the docstring of the context manager says, most of SymPy code expects automatic evaluation.
4
4
 
5
5
  とあるので限定された用途しかなさそうですが。
6
+
7
+ 結果例
8
+ ```python
9
+ >>> with sympy.evaluate(False):
10
+ ... print(1/sympy.sqrt(2))
11
+ 1/(sqrt(2))
12
+ ```
6
13
 
7
14
  ----
8
15