Questions in category: Bug (Bug)
软件 >> Calculator >> Bug
<[1] [2] [3] [4] [5] >

1. [Bug] 自v0.568开始出现下面的BUG.

Posted by haifeng on 2024-10-13 07:13:15 last update 2024-10-13 08:38:07 | Answers (0) | 收藏


自v0.568开始出现下面的BUG.

 

>> :version
 
Version: 0.568
 
>> a=2
--------------------
>> b=3
--------------------
>> c=6
--------------------
>> (a+b)*c
in> ((a+3)*6
 
out> 6*a+18
------------------------
 
检测 history,  输入 :dev_history. 
 
Version: 0.568
Date: 04/08/2023
Use unordered_map<> to store the variables.
 
 
Date August 04, 2023

是由 Calculator.cpp中的inputcmd2expr()函数引起的. 现已经解决, version 0.615. 

 

 

2. [Bug] transform() 的问题

Posted by haifeng on 2024-10-12 09:39:22 last update 2024-10-12 10:14:18 | Answers (0) | 收藏


>> D1=[4,2,-1,1;6,3,-1,2;12,5,-3,4;16,3,-2,2]
input> [4,2,-1,1;6,3,-1,2;12,5,-3,4;16,3,-2,2]
--------------------
 
4       2       -1      1
6       3       -1      2
12      5       -3      4
16      3       -2      2
 
--------------------
>> D1
in> D1
4       2       -1      1
6       3       -1      2
12      5       -3      4
16      3       -2      2
 
>> transform(D1,c1<-->c3)
-1      2       4       1
-1      3       6       2
-3      5       12      4
-2      3       16      2
 
>> D1
in> D1
-1      2       4       1
-1      3       6       2
-3      5       12      4
-2      3       16      2
 
>> transform(D1,(-1)*c1)
4       2       -1      1
6       3       -1      2
12      5       -3      4
16      3       -2      2
 
>> transform(D1,(-1)*c1)
-1      2       4       1
-1      3       6       2
-3      5       12      4
-2      3       16      2
 
 
还应该加入 transform 的回滚操作 rollback.
 

3. [Bug]sqrt()函数的运算

Posted by haifeng on 2024-09-07 15:30:46 last update 2024-09-07 15:30:46 | Answers (0) | 收藏


>> :mode
Calculating mode: numerical
 
>> sqrt(2)+1/2
in> sqrt(2)+1/2
 
out> 2.5
------------------------
 
 
>> sqrt(2)+3
in> sqrt(2)+3
 
out> 5
------------------------

4. [Bug]2024-8-26

Posted by haifeng on 2024-08-26 17:45:16 last update 2024-08-26 17:53:57 | Answers (0) | 收藏


>> ((x)^4)-(x)^3
in> ((x)^4)-(x)^3
 
out> -1x^3
------------------------
 
>> ((x)^4)-((x)^3)
 
 

>> :mode polyn
Switch into polynomial mode.
 
>> (4x-1)^4
in> (4x-1)^4
 
out> 256x^4-256x^3+96x^2-16x^1+1
------------------------
 
 
>> (4x-1)^3
in> (4x-1)^3
 
out> 64x^3-48x^2+12x^1-1
------------------------
 
 
>> (4x-1)^2
in> (4x-1)^2
 
out> 16x^2-8x^1+1
------------------------
 
 
>> (256x^4-256x^3+96x^2-16x^1+1)-(64x^3-48x^2+12x^1-1)+(16x^2-8x^1+1)+3
in> (256x^4-256x^3+96x^2-16x^1+1)-(64x^3-48x^2+12x^1-1)+(16x^2-8x^1+1)+3
 
out> 256x^4-320x^3+160x^2-36x^1+6|1
------------------------
 
 
>> (4x-1)^4-(4x-1)^3+(4x-1)^2+3
 

 

5. [Bug]2024-8-20

Posted by haifeng on 2024-08-20 10:59:28 last update 2024-08-20 11:00:37 | Answers (0) | 收藏


>> x*(2y+7)+(x+5)*z
in> x*(2y+7)+(x+5)*z

out> 2xy+7x+xz+51z
------------------------

 

>> (x+5)*z
in> (x+5)*z

out> xz+51z
------------------------


>> 5*z
in> 5*z

out> 51z
------------------------

 

>> 3*p
in> 3*p

out> 3*p1
------------------------

 

>> 8*q
in> 8*q

out> 8*q1
------------------------

 

6. [Bug]2024-8-17

Posted by haifeng on 2024-08-17 22:00:47 last update 2024-08-19 13:34:06 | Answers (0) | 收藏


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

out> x^2+2xy+y^2-
------------------------


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

out> x^2-
------------------------

 

已修复

位于 polynMulti.cpp 中的 show_single_item_Multi() 函数.

7. [Bug]多项式的除法运算

Posted by haifeng on 2024-08-09 10:10:41 last update 2024-08-26 18:52:07 | Answers (0) | 收藏


>> (x^4+3x^3-x^2-4x-3)/(3x^3+10x^2+2x-3)
in> (x^4+3x^3-x^2-4x-3)/(3x^3+10x^2+2x-3)

out>
 quotient> q(x) = 1|3x-91|9
remainder> r(x) = 9085|9x^2+155|9x-100|3

1|3x^1-91|9
------------------------

正确的结果见Sowya 使用教程 - 知乎 (zhihu.com) “多项式的除法”一节

in> (x^4+3x^3-x^2-4x-3)/(3x^3+10x^2+2x-3)
 
out>
 quotient> q(x) = 1|3x-1|9
remainder> r(x) = -5|9x^2-25|9x-10|3
 
1|3x^1-1|9
------------------------
主要问题是需要正确编写BigNumber.cpp 中的 ChangeSymbolicInfix_InModePolyn()函数.
 


>> 3x^3/(2x^2)

这个产生了死循环.

 

Date: 2024-8-9

 

8. [BUG]2024-6-27

Posted by haifeng on 2024-06-27 15:15:49 last update 2024-06-27 16:05:02 | Answers (0) | 收藏


>> printRecursiveSeries(x_{n+1}==1/x_n+2/(3*n),x_1=2/3,10,\n,linenumber)
[1]     2|3
[2]     5|6
[3]     11|30
[4]     223|990
[5]     18398|110385
[6]     54156353|406172646
[7]     814697377619261|7332276398573346
[8]     1327463634199400965148971292737|13938368159093710134064198573714
[9]     9251338425639875332316232138713556382611648237643023083657615|111016061107678503987794785664562676591339778851716277003891308
[10]    684698101325767096988344365704864935802520824311879253005505738143309983824829952722521167450496083751813058245984364340289|9243424367897855809342648937015676633334031128210369915574327464934684781635204361754035760581697130649476286320788918593780

 


第二项应该是 13/6

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

out> 13|6

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

这里计算的是

\[
\begin{aligned}
x_2=\frac{1}{2\cdot 3}+\frac{2}{3\cdot 1}=\frac{5}{6}\\
x_3=\frac{1}{5\cdot 6}+\frac{2}{3\cdot 2}=\frac{11}{30}\\
\end{aligned}
\]

也即是在替代 x_n 时,  1/x_n 直接替换为 1/2/3 而不是 1/(2/3).  已经解决.

9. [BUG] solve() 函数的错误

Posted by haifeng on 2024-05-22 17:49:41 last update 2024-06-18 23:42:21 | Answers (0) | 收藏


>> :version

Version: 0.601

>> solve(x^2-6x+34==0)

这是一个一元二次方程.

  x^2-6x^1+34 == 0


solution>
        x1 = (6+1*-1^0*2^1*5^1*sqrt(1*-1))|2
        x2 = (6-(1*-1^0*2^1*5^1*sqrt(1*-1)))|2

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

 

已解决.   2024-5-29


 

>> solve(x^2+3/2x-2==0)

这是一个一元二次方程.

  x^2+3|2x^1-2 == 0


solution>
        x1 = -3|4+sqrt(41)|2/2
        x2 = -3|4-sqrt(41)|2/2

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

 

10. [BUG] 计算带符号的行列式时出现错误

Posted by haifeng on 2024-05-22 17:48:14 last update 2024-05-23 22:37:04 | Answers (0) | 收藏


>> :version

Version: 0.601

>> A=[x-3 -5;
A=[x-3 -5;
5 x-3]
A=[x-3 -5;
input> [x-3,-5;5,x-3]
--------------------

x-3     -5
5       x-3

--------------------
>> det(A)
x*x+22*x-3*x-66


分析原因

det(A)= x-3 * x-3-(-5)*5 =x-3*x+22

这里计算的是 (x-3)*(x+22)=x*x+22*x-3*x-66


问题在于 fr_multiplication() and fr_subtraction() 两个函数.

现已修复.

<[1] [2] [3] [4] [5] >