问题

软件 >> Calculator
Questions in category: Calculator (Calculator).

[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.
==================================================
>>