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

11. 解不定方程 $7x+4y=1$.

Posted by haifeng on 2022-09-21 00:02:58 last update 2022-09-21 00:02:58 | Answers (0) | 收藏


解不定方程 $7x+4y=1$.

 

>> IndefiniteEquation(7,4)
in> IndefiniteEquation(7,4)
Solve the equation: 7*x+4*y = 1
7==1*4+3
4==1*3+1
1 1
test: 1==4*2-7*1
4*2-7*1 == 1
x = -1+4t
y = 2-7t


-----------***---------

 

>> IndefiniteEquation(7,4;1)
in> IndefiniteEquation(7,4;1)
Solve the indefinite equation :
7*X1+4*X2 = 1

u1=1-3*u0
---------------
X1 = -1*u1+u0
X2 = -1*X1+u1

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

 

12. 求解不定方程 $7x_1+4x_2-2x_3+3x_4=2$.

Posted by haifeng on 2022-09-18 14:41:44 last update 2022-09-19 16:41:52 | Answers (0) | 收藏


>> IndefiniteEquation(7,4,-2,3;2)
in> IndefiniteEquation(7,4,-2,3;2)
Solve the indefinite equation :
7*X1+4*X2-2*X3+3*X4 = 2

X4=2-2*u2-X1
---------------
X4 = +X4
X3 = +3*X1+2*X2+1*X4-u2

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

 


>> IndefiniteEquation(7,4,-2,3;2)
in> IndefiniteEquation(7,4,-2,3;2)
Solve the indefinite equation :
7*X1+4*X2-2*X3+3*X4 = 2

X4=2-X1-2*u2
---------------
X1 = +X1
X3 = +3*X1+2*X2+1*X4-u2

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

 

13. 求解不定方程 $25x-13y+7z=4$.

Posted by haifeng on 2022-09-18 14:40:09 last update 2022-09-18 14:40:09 | Answers (0) | 收藏


>> IndefiniteEquation(25,-13,7;4)
in> IndefiniteEquation(25,-13,7;4)
Solve the indefinite equation :
25*X1-13*X2+7*X3 = 4

u2=4-2u1
---------------
X2 = +2*u0+1*u2-u1
X1 = +1*X2-1*u2+u0
X3 = -3*X1+1*X2+u2

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

14. 求解不定方程 $x+2y+3z=4$.

Posted by haifeng on 2022-09-18 14:38:46 last update 2022-09-18 14:39:08 | Answers (0) | 收藏


>> IndefiniteEquation(1,2,3;4)
in> IndefiniteEquation(1,2,3;4)
Solve the indefinite equation :
1*X1+2*X2+3*X3 = 4

X3=4-X1-2u1
---------------
X2 = -1*X3+u1
X1 = +X1

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

15. 矩阵输入的问题

Posted by haifeng on 2022-09-04 20:46:26 last update 2022-09-06 09:24:10 | Answers (0) | 收藏


CalculatorApp.exe 对于矩阵输入, 在 0.516 版本中将回车视为一行结束, 即等价于分号;

例如, 输入

B=[1,2,3
4;3,2,0
1;0,2,0,9;1,3,5,
-1]

将得到下面的结果:

[var] B
1 2 3 0 
4 0 0 0 
3 2 0 0 
1 0 0 0 
0 2 0 9 
1 3 5 0 
-1 0 0 0 
input> [1,2,3;4;3,2,0;1;0,2,0,9;1,3,5,;-1]
det(B)=NaN
--------------------
>> 


而在 calculator.exe 下, 换行等同于逗号. 同样上面的输入得到:

input> [1,2,3,4;3,2,0,1;0,2,0,9;1,3,5,-1]
det(B)=-143
----------------------------
 type: matrix
 name: B
value:
1       2       3       4
3       2       0       1
0       2       0       9
1       3       5       -1

determinant: -143
--------------------


哪一种输入方案更好?

 

个人更倾向于第二种方案, 因为有时矩阵的列数很多, 一行输入不下, 换行是需要的.

从 v0.517 开始, CalculatorApp.exe 采用第二种方案.


calculator.exe  v0.518测试

B=[1 2 3
4;3,2,0
1;0,2,0,9;1,3,5,
-1]

16. [Bug] Calculator

Posted by haifeng on 2022-09-01 23:40:05 last update 2022-09-01 23:40:05 | Answers (0) | 收藏


>> A=[1 2; 3 4]
input> [1,2;,3,4],;

 

17. [Bug] Calculator 分数运算中乘幂的Bug

Posted by haifeng on 2022-08-22 08:01:54 last update 2023-07-08 08:50:00 | Answers (0) | 收藏


>> (1/5+1/3)^2
in> (1/5+1/3)^2

out> 7111111|25000000


实际上应等于 64|225

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

out> 64|225


[分析原因]

>> 64/225
in> 64/225

out> 0.28444444

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


>> 7111111/25000000
in> 7111111/25000000

out> 0.28444444

这两个分数在

(1/5+1/3)^2 在分数模式下, 仍然将 (1/5+1/3) 作数值计算, 得到 0.53333333, 然后再进行分数运算.

>> 0.53333333^2
in> 0.53333333^2

out> 7111111|25000000


注: 这个 Bug 是在使用数字帝国上的分数运算器发现的.

分数计算器 (1/5+1/3)^2 (numberempire.com)


现在 Bug 已经解决.

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

>> (1/5+1/3)^(2)
in> (1/5+1/3)^(2)

out> 64|225

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


>> (1/5+1/3)^(1/2)
in> (1/5+1/3)^(1/2)

out> sqrtn(8,2)|sqrtn(15,2)

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

v0.562

修改BigNumber.cpp 中的 EvalForFractionMode() 函数,  将结果显示为

>>  (1/5+1/3)^(1/2)
in> (1/5+1/3)^(1/2)

out> 2*sqrtn(2, 2)|sqrtn(15, 2)

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

 

18. [BUG] Calculator 计算阶乘时的 bug.

Posted by haifeng on 2022-08-07 08:51:08 last update 2022-08-07 08:58:01 | Answers (0) | 收藏


//BUG: 当输入 (5 - 1)!(3 - 1) 会出现下面的bug

>> (5 - 1)!(3 - 1)
in > (5 - 1)!(3 - 1)

out > str1 = 1, _str1 = 1
str2 = 2, _str2 = 2
str1 = 1, _str1 = 1
str1 = 1, _str1 = 1
in > 1!2
diff = -1


>> 5!(a-b)
in> 5!(a-b)

out> str1=5, _str1=5
str2=1, _str2=1
str1=5, _str1=5
str1=5, _str1=5
in>5!1
diff=4
120*a-120*b


【分析】这里程序将 ! 后面的默认理解为 1. 即 5!(a-b) 理解为 5!*(a-b)

而  (5 - 1)!(3 - 1) 理解为  (5-1)*1!(3-1)

19. 如何查看 dll 中的函数名称?

Posted by haifeng on 2022-08-06 07:31:49 last update 2022-08-06 07:32:36 | Answers (0) | 收藏


 

1. 打开 Visual Studio 2019 Developer Command Prompt

2. 转到 dll 所在目录, 比如 D:\work\cs\c++\vs2019\calculator_vc\DynamicCalculator\Release

3. 使用 dumpbin 命令

dumpbin /exports Calculator_dll.dll > D:\Calculator_dll.txt

 

 

20. 在 Windows 下运行 Calculator.exe, 显示缺少 MSVCP140.dll.

Posted by haifeng on 2022-08-05 12:46:45 last update 2022-08-05 12:46:45 | Answers (0) | 收藏


在 Windows 下运行 Calculator.exe, 显示缺少 MSVCP140.dll. 

解决办法: 

Latest supported Visual C++ Redistributable downloads | Microsoft Docs

下载 VC_redist.x86.exe , 然后安装即可.

 

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