Make multiply great again
This commit is contained in:
parent
957e484db5
commit
2057d2b14f
10
polymani.pl
10
polymani.pl
@ -210,7 +210,13 @@ do_process_input(simplify(PT)) :-
|
||||
do_process_input(multiply(TN, PT)) :-
|
||||
polynomial_tree_to_polynomial(TN, N),
|
||||
polynomial_tree_to_polynomial(PT, P),
|
||||
scalepoly(N, P, P2),
|
||||
(
|
||||
not(number(N)),
|
||||
scalepoly(N, P, P2)
|
||||
;
|
||||
number(N),
|
||||
scalepoly(P, N, P2)
|
||||
),
|
||||
simpoly(P2, SP),
|
||||
write(SP),
|
||||
nl.
|
||||
@ -552,7 +558,7 @@ parse_command(simplify(T)) -->
|
||||
parse_polynomial(T).
|
||||
parse_command(multiply(TN, TP)) -->
|
||||
[multiply],
|
||||
parse_number(TN),
|
||||
parse_polynomial(TN),
|
||||
[by],
|
||||
parse_polynomial(TP).
|
||||
parse_command(op(-, TN, TP)) -->
|
||||
|
Reference in New Issue
Block a user