mirror of
https://gitee.com/open-loongarch/buildroot-2024.08.git
synced 2026-10-28 14:07:12 +08:00
first commit: base 2024.08
Signed-off-by: maoxiaochuan <maoxiaochuan@loongson.cn>
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
#! /usr/bin/env python3
|
||||
|
||||
from sympy import symbols, expand, factor
|
||||
|
||||
x, y = symbols('x y')
|
||||
|
||||
expr = x + 2*y
|
||||
|
||||
expanded_expr = expand(x*expr)
|
||||
print(expanded_expr)
|
||||
assert str(expanded_expr) == "x**2 + 2*x*y"
|
||||
|
||||
factored_expr = factor(expanded_expr)
|
||||
print(factored_expr)
|
||||
assert str(factored_expr) == "x*(x + 2*y)"
|
||||
Reference in New Issue
Block a user