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

31. 关于 $!n$

Posted by haifeng on 2020-11-15 10:22:50 last update 2021-05-11 09:39:09 | Answers (0) | 收藏


$!n$ 定义为 

\[
!n=1!+2!+3!+\cdots+n!=\sum_{k=1}^{n}k!
\]

 

在 Calculator 中做实验:

 

>> !10
in> !10

out> 4037913

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


>> sum(n!,n,1,10)
in> sum(n!,n,1,10)

out> 4037913

 


计算 !5

 

 

32. Visual Studio 2015的项目当使用Visual Studio 2019打开时碰到问题

Posted by haifeng on 2020-09-24 15:44:11 last update 2020-09-25 11:04:52 | Answers (0) | 收藏


D:\work\cs\c++\vs2019\calculator_vc\calculator\calculator\calculator.vcxproj : warning  : 无法找到 Visual Studio 2010 (v100) 的生成工具。若要使用 Visual Studio 2019 (v142) 生成工具进行生成,请单击“项目”菜单或右键单击解决方案,然后选择“重定向解决方案...”。安装 Visual Studio 2010 (v100) 可使用 Visual Studio 2010 (v100) 生成工具进行生成。

 


 

错误 LNK2019 无法解析的外部符号 _fprintf,函数 _crypt_argchk 中引用了该符号 calculator D:\work\cs\c++\vs2019\calculator_vc\calculator\calculator\tomcrypt.lib(crypt_argchk.obj) 1

 

解决办法:

右键calculator项目, 点击【属性】,在【配置属性】-->【链接器】-->【输入】-->【附加依赖项】中加入 legacy_stdio_definitions.lib


 

1>------ 已启动生成: 项目: calculator, 配置: Debug Win32 ------
1>tomcrypt.lib(md5.obj) : warning LNK4099: 未找到 PDB“vc100.pdb”(使用“tomcrypt.lib(md5.obj)”或在“D:\work\cs\c++\vs2019\calculator_vc\calculator\Debug\vc100.pdb”中寻找);正在链接对象,如同没有调试信息一样
1>tomcrypt.lib(sha1.obj) : warning LNK4099: 未找到 PDB“vc100.pdb”(使用“tomcrypt.lib(sha1.obj)”或在“D:\work\cs\c++\vs2019\calculator_vc\calculator\Debug\vc100.pdb”中寻找);正在链接对象,如同没有调试信息一样
1>tomcrypt.lib(sha256.obj) : warning LNK4099: 未找到 PDB“vc100.pdb”(使用“tomcrypt.lib(sha256.obj)”或在“D:\work\cs\c++\vs2019\calculator_vc\calculator\Debug\vc100.pdb”中寻找);正在链接对象,如同没有调试信息一样
1>tomcrypt.lib(crypt_argchk.obj) : warning LNK4099: 未找到 PDB“vc100.pdb”(使用“tomcrypt.lib(crypt_argchk.obj)”或在“D:\work\cs\c++\vs2019\calculator_vc\calculator\Debug\vc100.pdb”中寻找);正在链接对象,如同没有调试信息一样
1>calculator.vcxproj -> D:\work\cs\c++\vs2019\calculator_vc\calculator\Debug\calculator.exe
1>已完成生成项目“calculator.vcxproj”的操作。

 

参考

https://www.cnblogs.com/wainiwann/p/3446187.html

 


C6262 错误

https://blog.csdn.net/mxclxp/article/details/7991127

 


warning C4273: dll 链接不一致

1>register.cpp
1>D:\download\C++\crypt\LibTomCrypt\others\libtomcrypt-master\src\headers\tomcrypt_cfg.h(26,45): warning C4273: “malloc”: dll 链接不一致
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\corecrt_malloc.h(97,15): message : 参见“malloc”的前一个定义
1>D:\download\C++\crypt\LibTomCrypt\others\libtomcrypt-master\src\headers\tomcrypt_cfg.h(27,55): warning C4273: “realloc”: dll 链接不一致
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\corecrt_malloc.h(122,15): message : 参见“realloc”的前一个定义
1>D:\download\C++\crypt\LibTomCrypt\others\libtomcrypt-master\src\headers\tomcrypt_cfg.h(28,55): warning C4273: “calloc”: dll 链接不一致
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\corecrt_malloc.h(62,15): message : 参见“calloc”的前一个定义
1>D:\download\C++\crypt\LibTomCrypt\others\libtomcrypt-master\src\headers\tomcrypt_cfg.h(29,40): warning C4273: “free”: dll 链接不一致
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\corecrt_malloc.h(85,14): message : 参见“free”的前一个定义
1>D:\download\C++\crypt\LibTomCrypt\others\libtomcrypt-master\src\headers\tomcrypt_cfg.h(31,113): warning C4273: “qsort”: dll 链接不一致
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\corecrt_search.h(56,23): message : 参见“qsort”的前一个定义
1>D:\download\C++\crypt\LibTomCrypt\others\libtomcrypt-master\src\headers\tomcrypt_cfg.h(35,41): warning C4273: “clock”: dll 链接不一致
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\time.h(138,26): message : 参见“clock”的前一个定义

 

在编译libtomcrypt 时, 修改设置

参考

https://blog.csdn.net/bendangth/article/details/47356767?utm_medium=distribute.pc_relevant.none-task-blog-title-1&spm=1001.2101.3001.4242

https://blog.csdn.net/visualcatsharp/article/details/3866349

https://blog.csdn.net/net_wolf_007/article/details/5182376

 

33. Calculator 中的函数

Posted by haifeng on 2020-05-05 10:27:03 last update 2020-05-05 10:27:03 | Answers (0) | 收藏


在 Calculator 中可以使用 listfunctions() 函数列出当前系统中预设的所有函数.

listfunctions() 还可以接受参数 1, 即 listfunctions(1), 它将列出所有函数的原型. 

如果要查看函数的用法, 可以使用 help() 函数, 比如 help(len) 将显示 len() 函数的用法.

 

>> listfunctions()
in> listfunctions()
Collatz
binary2decimal
binary2graycode
binom
cubicsum
cubicsum2
decimal2binary
decimal2fraction
decimal2hex
decimal2octal
eq24
exp
expmo
factorial
factorise
firstfactor
fix_variables
gcd
getValueFromMemAddr
getprecision
graycode2binary
help
iscomposite
isprime
ispseudoprime
lcm
len
listfunctions
listpseudoprimes
ln
log
nextprime
pi
prevprime
print3x1Maps
q_DuanwuPlus
q_duanwu
setprecision
solve
sqrt
sqrtn
sum
symbol
trimzeros
xor


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

>> listfunctions(1)
in> listfunctions(1)
Collatz(num)
binary2decimal(binary)
binary2graycode(binary)
binom(n,k)
cubicsum(max,compareWith)
cubicsum2(min,max,compareWith)
decimal2binary(num)
decimal2fraction(num)
decimal2hex(num)
decimal2octal(num)
eq24(p1,p2,p3,p4)
exp(num)
expmo(base,power,mod)
factorial(positiveinteger)
factorise(positiveInteger)
firstfactor(positiveInteger)
fix_variables(bool)
gcd(num1,num2)
getValueFromMemAddr(memoryAddress)
getprecision(positiveinteger)
graycode2binary(binary)
help(funcName)
iscomposite(positiveinteger)
isprime(positiveinteger)
ispseudoprime(positiveinteger)
lcm(num1,num2)
len(string)
listfunctions(bool)
listpseudoprimes(positiveinteger)
ln(num)
log(num)
nextprime(positiveinteger)
pi()
prevprime(positiveinteger)
print3x1Maps(from,to)
q_DuanwuPlus(positiveinteger)
q_duanwu(positiveinteger)
setprecision(positiveinteger)
solve(equation,x,minValue,maxValue)
sqrt(num)
sqrtn(num,k)
sum(general_term,x,minValue,maxValue)
symbol(x,val)
trimzeros(num)
xor(num1,num2)


Total: 45

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

>>

34. [Calculator]下载

Posted by haifeng on 2019-10-11 11:31:04 last update 2020-12-18 19:48:41 | Answers (0) | 收藏


Calculator 下载地址:

atzjg.net 首页有下载链接.

 

详细链接地址

http://atzjg.net/content/download/software/calculator/calculator.exe

 

 

35. [Calculator] 打印帮助

Posted by haifeng on 2019-10-11 11:03:40 last update 2019-10-11 11:17:28 | Answers (0) | 收藏


Calculator中如果要打印帮助, 可以使用 :h 或 :help 命令

 

>> :h
==================================================
CALCULATOR
==================================================

This calculator supports the following operations:

+, -, *, /, %, ^, mod, !

try:
(5 + 2) * 3 / 7
a=123
b=456
a+b
len(2305843009213693951)
type `:more` (without '`') to show the examples.
`:h` or `:help` to display this hint.
`:thanks` to show the thanks.
`:about` to show the information of this program.
`:version` to print the version of this program.
`:q` or `:quit` or `:exit` to quit this program.


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

 

如果要列出更多功能, 则输入 :more

 

>> :more
==================================================
MATHEMATICAL OPERATIONS
==================================================


Calculator

More Functions

setprecision(12) -- 6 is default precision for division.

Examples:
(5+2)*3/7 -- will calculate the value
-- blank is allowed, try ( 5+ 2) *3 /7
2^1000 -- try it, it is a big number.
isprime(19) -- will return 19 is a prime number.
isprime(2^31-1) -- test whether it is a Mersenne Prime.
iscomposite(20) -- will return 20 is a composite number.
ispseudoprime(341) -- will return 341 is a pseudo prime number.
nextprime(20) -- will return 23.
prevprime(20) -- will return 19.
firstfactor(332797) -- will return 41.
factorise(29399071280019123498) -- 2*3*173*... , try it.
factorial(9) -- means 9!, try input 9!+1
9!6 -- means 9*8*7*6
!9 -- means 1!+2!+3!+...+9!
19 mod 7 -- you can use @ instead of `mod`
if you calculate 2^180000 mod 7, please use expmo(2,180000,7) instead.
sqrt(2) -- the square root of 2, try sqrt(1.21)
sqrtn(a,n) -- the n-th root of number a
binom(5,2) -- the binomial coefficient
gcd(15,12) -- the Greatest Common Divisor
lcm(15,12) -- the Least Common Multiple
xor(10110,1101) -- exclusive or
binary2graycode(10110) -- binary number to gray code
graycode2binary(01001) -- gray code to binary number


binary2decimal(10110) -- binary number to decimal number
decimal2binary(10110) -- decimal number to binary number


decimal2octal(10110) -- decimal number to octal number
decimal2hex(10110) -- decimal number to hexadecimal number


decimal2fraction(1.25) -- decimal number to fraction

exp(x) -- exponential function, try exp(), it is equal to exp(0)

log(x) -- logarithmic function


Compare two numbers:
use <, > or == to compare two numbers.
==================================================
DEFINE VARIABLES DYNAMICALLY
==================================================
Choose which type of variable to define:
type:
a=123
% this will define a variable named a
% try define string or double ...
b="hello world"
pi=3.1415926
-------------------------------------
type `:h` `:help` to display help
`:more` to display hint
`:list` to list all variables defined.
`:clear` to clear all variables.
`:q` or `:quit` or `:exit` to quit.
getValueFromMemAddr(...)


==================================================
APPLICATIONS
==================================================
solve(equation,x,minValue,maxValue), for example:
solve(x^(341-1)mod341==1,x,1,340)
eq24(2,6,12,12) A game to compute 24 by given numbers
Collatz(9) will print the route of 9 to 1
in Collatz conjecture or 3x + 1 conjecture.
==================================================
OTHER FUNCTIONS
==================================================
type `:dev_history` to show the history of
development.
`fix_variables(1)` make variables unchangeable.
`fix_variables(0)` is default setting.
==================================================
>>

 

 

 

 

36. [Calculator]开发历史

Posted by haifeng on 2019-10-11 11:01:07 last update 2021-03-21 20:47:53 | Answers (0) | 收藏


Calculator.exe 中可使用 :dev_history 打印开发的历史

>> :dev_history
Version: 0.441
Date: 24/11/2018
        exp(x)

Version: 0.442--0.443
Date: 04/01/2019
        log(x), ln(x), and fixed some bugs, such as operator==,
Now we can compare .9==0.9 and so on.

Version: 0.444
Date: 04/01/2019
        Variables can be defined.
        fix_variables(1)
        a="1+2/3"
        a=2+3*9
        :clear

Version: 0.445
Date: 08/03/2019
        Add two functions:
        binary2decimal()
        decimal2binary()

Version: 0.446
Date: 17/03/2019
        Add extra file in project, functions.h:
        which contains self defined functions.
        Fixed function sqrtn()

Version: 0.447
Date: 21/03/2019
        :change the function declaration IntDivision(string &, string &) to IntDivision(const string &, const string &)
        And change power operation to fast algorithm.

Version: 0.448
Date: 01/04/2019
        :Improved the function plus(), and add char ( in operators[], so can deal with expression a+b*c+(d*e+f)*g if a,b,...,g are defined.

Version: 0.449
Date: 01/04/2019
        :Add function: solve(equation,x,minValue,maxValue).

Version: 0.450
Date: 06/06/2019
        exp(x)

fixed bug in computation IntDivision, that is: num1 % num2
add function decimal2octal(n)

add function decimal2hex(n)

add function firstFactor(n)

add function factorise(n)

Version: 0.451
Date: 27/07/2019
fixed bug of internal function ChangeInfix()
add function decimal2fraction(n)

add internal function isInteger(n)

add internal isPositiveInteger(n)

add internal isNegativeInteger(n)

add function !n=1!+2!+...+n!

Version: 0.452
Date: 27/08/2019
add function eq24(a,b,c,d)

Version: 0.453
Date: 06/09/2019
10%+10%
5%%3

Version: 0.454
Date: 19/09/2019
add function Collatz() and print3x1maps(a,b)

Version: 0.455
Date: 21/09/2019
add Lucas-Lehmer test for Mersenne primes in function isprime()
For example: isprime(2^89-1)

Version: 0.456
Date: 11/10/2019
Fixed some BUGs founded on 09-10-2019
For the previous versions, if you input the following :
>> p=3511
>> 2^(p-1)-1mod(p^2)

You will get 2^(3511-1)-1@(3511^2
That is, the last char ) is lost.

Version: 0.457
Date: 23/11/2019
Add function sum(general_term,n,min,max) on 09-10-2019

Version: 0.458
Date: 01/12/2019
Using hash function to deal with functions, add several functions, such as listfunctions(), help(funcName) and etc. on 01-12-2019

Version: 0.459
Date: 15/12/2019
Fix bug: -(-2) and -3^2 and etc. on 15-12-2019

Version: 0.460
Date: 24/01/2020
Fix bug: a=3
 a==3
 and etc. on 24-01-2020

Set values: a=3
 b=a
 and etc. on 24-01-2020

Version: 0.461
Date: 21/02/2019
Fix bug: binom(5,5)=∞ on 21-02-2020

Version: 0.462
Date: 05/03/2020
Add exmpo() in function list. on 05-03-2020

Version: 0.463
Date: 11/03/2020
Fix BUG: sum(i!,i,1,20) on 11-03-2020

Version: 0.464
Date: 11/03/2020
Fix BUG: sqrt(x) does not work when x is not an integer on 24-03-2020

Version: 0.465
Date: 02/04/2020
Set default precision to 8, and make some functions do quick calculation when precision is high. Date April 2, 2020

Version: 0.466
Date: 14/04/2020
Add funtion getprecision() and fix bug of function setprecision() when no parameter is given. Date April 14, 2020

Version: 0.467
Date: 16/04/2020
Modify the command class so that print the functions list ordered by name. Date April 16, 2020

Version: 0.468
Date: 29/04/2020
Add command :mode, and enable do fraction calculation. Date April 29, 2020

Version: 0.469
Date: 08/07/2020
Make it possible to do the fraction calculation. Date July 08, 2020

Version: 0.470
Date: 10/07/2020
Make function sum() work under the fraction calculation mode. Date July 10, 2020

Version: 0.471
Date: 22/07/2020
Compare fractions. (Comparer les fractions.) And we make the computing x! possible. For example, 3.4!=3.4*2.4*1.4. Date July 22, 2020

Version: 0.472
Date: 25/07/2020
Fix a bug, the result of  x mod 1 should be zero.
And add function continued_fraction(num,expression,detail,tex). Date July 25, 2020

Version: 0.473
Date: 28/07/2020
Still use function continued_fraction() to compute continued fraction.
e.g., continued_fraction(3,5,1,1,2). Date July 25, 2020

Version: 0.474
Date: 01/08/2020
Add function Farey(n) to generate Farey series. Date August 01, 2020


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

>> Version: 0.475
Date: 09/08/2020
Version 0.475 is the first version for register user. Date August 09, 2020

Version: 0.476
Date: 29/08/2020
Allow function sqrt() accept negative number. Date August 29, 2020

Version: 0.477
Date: 30/08/2020
Let function pi() return pi and pi(x) return the number of primes which is not greater than x. And add function list_pi_x(A,B) to print pi(x), where x is in [A,B]. Date August 30, 2020

Version: 0.478
Date: 01/09/2020
Fix bug in function q_DuanwuPlus(). Add function reverse() and reverse_plus(). If input `_` , then it will return the previous result. Date September 01, 2020

Version: 0.479
Date: 02/09/2020
Set system variables. Date September 02, 2020

Version: 0.480
Date: 06/09/2020
Permet au système d'effecteur des opérations symboliques. Date September 06, 2020

Version: 0.481
Date: 09/09/2020
Fix bugs in the symbolic operations such as +,-,*,/. Date September 06, 2020

Version: 0.482
Date: 22/10/2020
Change the infinity symbol ∞ to string `Inf` to avoid the error during arithmetic computation. Improved the operations including pre_power and etc. Date October 22, 2020

Version: 0.483
Date: 11/11/2020
Improved function eq24() such that it works under fraction mode. And improved the function fr_multiplication() and inputcmd2expression(). Date November 11, 2020

Version: 0.484
Date: 24/11/2020
Add functions: Primes(n), p(n) and index_of_prime(n). Date November 24, 2020

Version: 0.485
Date: 10/12/2020
Improved Factorise() and the calculation of n!. Try 10000! or  Factorise(10000!). Date December 10, 2020

Version: 0.486
Date: 18/12/2020
Fix bug in function Factorise(). Date December 18, 2020

Version: 0.487
Date: 24/12/2020
Fix greate bugs in symbol calculations. Date December 24, 2020

Version: 0.488
Date: 26/12/2020
Fix bugs in symbol calculations. Date December 26, 2020

Version: 0.489
Date: 27/12/2020
Fix bugs in symbol calculations. Date December 27, 2020

Version: 0.490
Date: 28/12/2020
Such expressions (x-1)(x+2) are allowed. Date December 28, 2020

Version: 0.491
Date: 14/03/2021
Add function Fibonacci(). Date March 14, 2021

Version: 0.492
Date: 21/03/2021
Improve the functions gcd() and lcm() and let them support multiparameters. Date March 21, 2021

并改进了 help() 函数.
-------------------

>>

 

37. [DevPlan] 在Calculator中加入求解一元n次方程的功能

Posted by haifeng on 2019-10-09 09:56:03 last update 2022-09-15 08:05:08 | Answers (0) | 收藏


开发计划

在Calculator中加入求解一元n次方程的功能, 这里 $n\leqslant 3$.

 

开发日志

 

首先要解决的问题是将输入的不规范方程表达式转换为标准的形式. 比如:

x^2-3x^3+7x-9=0   ===>  -3*x^3+1*x^2+7*x-9==0

系统存入系数向量 w=(-3,1,7,-9), 或者 w=(-9,7,1,-3), 后者方便记忆或转换, 比如 w[i] 即 x^i 的系数

 

 


References:

一元三次方程的求根公式的历史

https://blog.csdn.net/elvis_gao/article/details/1815561


 

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