问题

软件 >> Calculator >> 符号运算
Questions in category: 符号运算 (Symbolic operations).

记录 Calculator 的 BUG

Posted by haifeng on 2020-12-18 21:12:47 last update 2020-12-28 14:16:47 | Answers (0) | 收藏


[BUG]2020-12-18

>> a/b+c/d-c/d
in> a/b+c/d-c/d

out> (a*d+b*c*d-b*d*c)|(b*d*d)

正确的, 应该是 (a*d*d+b*c*d-b*d*c)|(b*d*d)

通过化简, 应该仍是 a/b 

 


>> (1+3a)/3+3/1
in> (1+3a)/3+3/1

out> a=1; b=1; c=3a; d=1
a=+3a; b=3; c=3; d=1
a+9

这里第二步, a=1+3a, 而不是 +3a


>> (a+3a)/3+3/1
in> (a+3a)/3+3/1

out> a=a; b=1; c=3a; d=1
a=a+3a; b=3; c=3; d=1
(a+3a+9)|3

------------------------


>> (2+3a)/3+3/1
in> (2+3a)/3+3/1

out> a=2; b=1; c=3a; d=1
a=2+3a; b=3; c=3; d=1
a+2+9


以上已解决

[BUG]2020-12-21

>> (1+3a)/3*(3/1)
in> (1+3a)/3*(3/1)

out> (3+9a))|3


>> (1+3a/3)*(a/1)
in> (1+3a/3)*(a/1)

out> 3a/1
3/1
3a/1
3/1
(3a+3a)*a/3
((3a+3a)*a)|3


[+(a +b +c) ]*[+d ]
_tmp = (a*d
_tmp = b*d
(a*d+b*d+c)*d/1
(a*d+b*d+c)*d


Bug 的原因在于这里是按 + 来分割的. 没有考虑 ( ) 的作用.

Remark: 以上 Bugs 都已经解决。2020-12-24

 

不过还有一点小问题:
 

>> ((3+a)*2-3(a-b)/c)*8
in> ((3+a)*2-3(a-b)/c)*8

out> a*2*8-8(3*a+3*b)/c+48

------------------------


>> :mode=fraction
Switch into fraction calculating mode.
e.g., 1/2+1/3 will return 5/6

>> ((3+a)*2-3(a-b)/c)*8
in> ((3+a)*2-3(a-b)/c)*8

out> 8(2(3+a)*c-3(a-b))|c

------------------------


>> :expand=on
Expand on. In fraction calculation mode,
e.g., (a+b)*(c+d) will return a*c+a*d+b*c+b*d.

>> ((3+a)*2-3(a-b)/c)*8
in> ((3+a)*2-3(a-b)/c)*8

out> 8(2(3+a)*c-3(a-b))|c
 ==> 8*2*a*c+8*6*c-8*3*a+8*3*b|


------------------------

[BUG] 2020-12-25,  无法识别 solve() 函数

>> solve(x^2==25,x,1,10)
in> solve(x^2~25,x,1,10)
cmd> solv
>> function solv() is not defined.

已解决 12-25


>> (a+3)-(b-4)
in> (a+3)-(b-4)

out> a-b7

应该返回 a-b+7.  已经解决.


在 numerical 模式(:mode=numerical)下

>> (((a+2)+3)-4)/4
in> (((a+2)+3)-4)/4

out> a1/4

分数计算模式下(:mode=fraction),  应该返回 a+1|4

已经解决  on  2020-12-26


>> (1+3a)/3*(3/1)
in> (1+3a)/3*(3/1)

out> 3(1+3*a)|3
 ==> 3*3*a+3|3


------------------------


>>  3*3*a+3
in> 3*3*a+3

out> (9*a+3)
 ==> 9*a+3

需要两次化简


>> 3*(a-(b*3-4)+d)/c
in> 3*(a-(b*3-4)+d)/c

out> 3(a-b*3-4+d)|c
 ==> 3*a-3*b*3+3*d-12|

BUG  2020-12-26


>> ((3+a)*2-3(a-(2b-3)+5)/c)*8
in> ((3+a)*2-3(a-(2b-3)+5)/c)*8

out> 8(c*2(3+a)-(3(a-2b-3+5)))|c
 ==> 16c*a+48c-24a+48b-48|c

BUG  2020-12-26

正确的应该是 16c*a+48c-24a+48b-192|c


>>  1-(a-3)/a
in> 1-(a-3)/a

out> -(a+3)/a+1

BUG  2020-12-26

正确的应该是  -(a-3)/a+1

已解决.


>> x(x-1)(x-3)
in> x(x-1)(x-3)
>> function x() is not defined.

>> 2(x-1)(x-3)
in> 2(x-1)(x-3)

out> (x-1)*(x-3)

------------------------


>> (x-1)(x-3)*2
in> (x-1)(x-3)*2

out> 2(x-3)

------------------------

>> (x-1)2*(x-3)
in> (x-1)2*(x-3)

out> 2x-6

这个不算是BUG, 这里的输入有误, (x-1)后面如果是数, 需要添加*

------------------------


>> ()2*(x-3)
in> ()2*(x-3)

out> 2x-6

这个也不算是BUG.

------------------------

已解决

>> (x-1)(x+2)
in> (x-1)*(x+2)

out> x*x+2x-x-2

------------------------