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

31. [Bug]分数模式下 sum 函数的bug

Posted by haifeng on 2023-05-01 11:47:35 last update 2023-05-01 16:37:53 | Answers (0) | 收藏


>> sum(1/8*((i-1)/8)^2,i,1,8)
(512*128*512*32*512*128*512*0*^2+51228445761339392+27584547717644288)|288230376151711744
------------------------

 

>> sum((i-1)^2,i,1,2)
(0*^2+0+^2)
------------------------

 

注: 在 v0.552 版本中已经得到修复.

32. [Bug] 求解一元二次方程

Posted by haifeng on 2023-04-22 10:11:25 last update 2023-04-25 20:57:48 | Answers (0) | 收藏


版本 v0.551

>> solve(x^2+1==0)

这是一个一元二次方程.

  x^2+1 == 0


solution>
        x1 = 2.00000000*i/2-/(2)
        x2 = -2.00000000*i/2-/(2)

 

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

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

>> solve(x^2+1==0)

这是一个一元二次方程.

  x^2+1 == 0

  Delta=b^2-4ac=-4
  sqrt(Delta)=2*i

solution>
        x1 = (+2*i)/2
        x2 = (-2*i)/2


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

33. [Bug]

Posted by haifeng on 2023-04-15 14:40:53 last update 2023-04-15 14:41:43 | Answers (0) | 收藏


>> A=[i j k;
A=[i j k;
-3 4 -6;
1 -1 5]
A=[i j k;
input> [i,j,k;-3,4,-6;1,-1,5]
det(A)=14*i+15*j-3*k-6*j-4*k
----------------------------
 type: matrix
 name: A
value:
i       j       k
-3      4       -6
1       -1      5

determinant: 14*i+15*j-3*k-6*j-4*k
--------------------

正确结果是 14i+9j-k

34. [Bug] 幂运算

Posted by haifeng on 2023-04-09 17:10:20 last update 2023-04-09 17:10:20 | Answers (0) | 收藏


>> (48/6)^(1/2)+(3)^(1/2)
in> (48/6)^(1/2)+(3)^(1/2)

out> (8^(1*sqrtn(1,2)+2)*sqrtn(3,2))|2)*sqrtn(1,2)

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

35. [Bug] 关于printRecursiveSeries()

Posted by haifeng on 2023-04-08 14:11:11 last update 2023-04-09 13:19:36 | Answers (0) | 收藏


>> printRecursiveSeries(a_n==n^2,n,1,10)
110

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

 

>> printRecursiveSeries(8x9,x,1,10,\n)
1

 

 

 

 

已经修复(2023-04-08)


in> printRecursiveSeries(8x9,x,1,10,\n)

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

 

>> printRecursiveSeries(8x+19,x,1,10,\n)
1
20
39
58
77
96
115
134
153
172

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

这里实际计算的是 $a_{n+1}=a_n+19$, $a_n=1$.

 


在分数模式下

>> printRecursiveSeries(8|3x9|2,x,1,10,\n)
1|1
8|319|2
232*|2|12122

退出

 

>> printRecursiveSeries(8|3*x*9|2,x,1,10,\n)
1
27
729
19683
531441
14348907
387420489
10460353203
282429536481
7625597484987

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

这里显然计算的是

 printRecursiveSeries(3*x*9,x,1,10,\n)

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

>> printRecursiveSeries(8/3*x_n*9/2,x_n,1,10,\n)
1
12.00000002
144.00000042
1728.00000720
20736.00011232
248832.00165888
2985984.02363904
35831808.32845824
429981700.47897600
5159780412.19743751

=========================

 

>>  8/3(1)
in> 8/3(1)

out> 3

 

>> 1/2(2)
in> 1/2(2)

out> 1
------------------------


>> 1/2(1)
in> 1/2(1)

out> 2
------------------------


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

out> 0.66666667
------------------------


>> 1/2(8)
in> 1/2(8)

out> 0.25
------------------------

也就是说, 这里的计算规则变为了 a/b(c) == b/c

36. [Bug] 多项式乘法的Bug

Posted by haifeng on 2023-03-28 13:37:03 last update 2023-03-28 19:24:16 | Answers (0) | 收藏


>> :mode polyn
Switch into polynomial mode.

>> (-27|5x+9) * (-1|3x+1|9)
in> (-27|5x+9)*(-1|3x+1|9)

out> 9|5x^2-3|5-3x^1+1
------------------------

正确结果应该是

9|5x^2-18|5x^1+1

 


 

输入 -3|5-3 会退出, 即使在 fraction 模式下. (已修复, 是上次改动计算模式导致的.)

 

 

37. [Bug] 指数为小数的幂

Posted by haifeng on 2023-03-25 08:44:58 last update 2023-06-05 14:47:19 | Answers (0) | 收藏


>> 1.007^2.98
in> 1.007^2.98

out> 2.-1-1-1-1-1-1-1-1-1
------------------------

>> 10.007^2.98
in> 10.007^2.98

out> 2110.00000000000000028607
------------------------

以上结果都是错的.

 


解决方案, 采用二元函数 $f(x,y)$ 在某一点的 Taylor 展开式来近似计算.

当 $x\in(0,2)$ 时, 可以考虑 $(1+x)^{\alpha}$ 的 Taylor 展开(见问题2927).

38. [Bug]

Posted by haifeng on 2023-03-24 23:06:25 last update 2023-03-28 20:25:44 | Answers (0) | 收藏


>> :mode=polyn
Switch into polynomial mode.

>> (2x^2-x+3)==(3-x+x^2+x^2)

导致退出

原因找到了, accept_number_as_string() 函数中读取单项式前系数时会将 3-x 看作 x 的系数.


>>  (1|3x^1-1|9)*(3x^3+10x^2+2x-3)+( -5|9x^2-25|9x^1-10|3)
in> (1|3x^1-1|9)*(3x^3+10x^2+2x-3)+(-5|9x^2-25|9x^1-10|3)

out> |9*x^1-10
------------------------


>> :mode polyn
Switch into polynomial mode.

>>  (1|3x^1-1|9)*(3x^3+10x^2+2x-3)+( -5|9x^2-25|9x^1-10|3)
in> (1|3x^1-1|9)*(3x^3+10x^2+2x-3)+(-5|9x^2-25|9x^1-10|3)

out> x^4+10|3-1|3x^3+2|3-10|9-5|9x^2-2|9-25|9-1x^1+1|3-10|3
------------------------

 

(1|3x^1-1|9)*(3x^3+10x^2+2x-3)+( -5|9x^2-25|9x^1-10|3)

1|1x^4+3|1x^3-4|9x^2-11|9x^1+1|3-5|9x^2-25|9x^1-10|3

正确的结果是

\[
\begin{split}
&(\frac{1}{3}x-\frac{1}{9})\cdot (3x^3+10x^2+2x-3)+(-\frac{5}{9}x^2-\frac{25}{9}x-\frac{10}{3})\\
= &\frac{1}{9}(3x-1)\cdot(3x^3+10x^2+2x-3)+(-\frac{5}{9}x^2-\frac{25}{9}x-\frac{10}{3})\\
= &\frac{1}{9}(9x^4+30x^3+6x^2-9x-3x^3-10x^2-2x+3)+(-\frac{5}{9}x^2-\frac{25}{9}x-\frac{10}{3})\\
= &\frac{1}{9}(9x^4+27x^3-4x^2-11x+3)-\frac{1}{9}(5x^2+25x+30)\\
= &\frac{1}{9}(9x^4+27x^3-9x^2-36x-27)\\
= & x^4+3x^3-x^2-4x-3
\end{split}
\]

39. 为算廿四函数 eq24() 添加别名

Posted by haifeng on 2023-03-16 08:44:40 last update 2023-08-29 16:00:16 | Answers (0) | 收藏


v0.574 中为 eq24() 添加别名 s24() 和 suo(). 并且增加了功能, 可以添加第五个参数.

eq24(1,3,5,7) 等价于 eq24(1,3,5,7;24)

在 cmd 终端交互式输入下,  

>> eq24(1,3,5,7)
in> eq24(1,3,5,7)

(1+5)*(7-3)==24
(5+7)*(3-1)==24

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

Total: 2

 

>> eq24(2,3,5,7)

 

3*5+2+7==24
3*7-2+5==24
7*(5-2)+3==24
3*7+5-2==24
3-7*(2-5)==24

 

40. [BUG]

Posted by haifeng on 2023-02-24 19:42:52 last update 2023-02-24 19:42:52 | Answers (0) | 收藏


>> -5*(-1)/6+1/4
in> -5*(-1)/6+1/4

out> 13|12

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


>> -5*(-1)|(6)+1/4
in> -5*(-1)|(6)+1/4

out> 21|4

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

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