Service  How to use  Sample calculation
 How to use 

 Index
  This Keisαn service aims to achieve the high precision of calculation by applying Arithmetic Operation System with variable number of digits.

 Feature of Keisαn service
1. The number of operation digits can be specified.
  Example) digit number 6 √5=sqrt (5)=2.23607 
    digit number 14 √5=sqrt(5)=2.2360679774998
2. All operations inside CPU are carried out in the decimal system.
  Example) Keisαn (0.9-0.3*3)= 0 
    Excel (0.9-0.3*3)= 1.11022E-16 This error is caused by the conversion from binary to decimal.
3. The number of correct digits in the operation result is automatically judged and the precise operation result is returned.
  Example) digit number 6   1-0.999876= 1.24000E-4
    digit number 10   gamma(3.5)=3.323350970
4. Complex number, probability function, special function, and repeated calculation can be handled.
  Example)
Complex number calculation
digit number 6

(1+i)^(1+i) = 0.273957+0.583701i
    Error function
digit number 6

 x=0.1   erf(x)= 0.112463
   
Repeated calculation   
 x=2,1,5 sqrt(x)=
x sqrt(x)
2 1.41421
3 1.73205
4 2
5 2.23607
6 2.44949
  
5. The library of expressions can be utilized.
  Example) Area of triangle s=(a+b+c)/2;a=3;b=4;c=5;sqrt(s*(s-a)*(s-b)*(s-c))
 Description rule of expression
1. Numerical value
The numerical value is displayed with combination of 0,1,2,3,4,5,6,7,8,9, .(decimal point), E(exponent), i (imaginary number), + and - .
  Example) 12340.56789    
    E2 100 (1* 102)
    1.23E+4 12300 (1.23* 104 note: + after E is the sign of exponent followed by integer.)
    1.23E-4 0.000123 (1.23*10-4 note: - after E is the sign of exponent followed by integer.)
    i 0+1i  
    E+2i 0+100i  
    1.23+4.56i   (Note: In order to handle the expression as complex number, put it in the parenthesis.)
    1.23-4.56i   (Note: In order to handle the expression as complex number, put it in the parenthesis.)
    1.23E3+4.56E2i 1230+456i  
    1.23E-3-4.56E+2i 0.00123-456i  
  Note) A capital letter E is used for an exponent. (A small letter e is used for Napier's constant.) 
2. Variable
The variable begins with an English letter and is composed of letters, words and/or numbers.
However, it is not possible to use the same variable identifier as special sign and reserved word.
  Valid variable identifier: a sinx a3 interest rate and the like  
    Invalid variable identifier: reserved word such as e, i, inf, sin and #abc  
3. Function
The function consists of the reserved word, and the one or more of arguments which are surrounded by the parenthesis.
  If there are more than two arguments, they have to be divided by comma.
  The numerical value, variable, function and expression can be described as the argument.
  Example) sin(x)
  normalcd(x,μ,2)
  normalcd(x+y,ln(12),σ)
pi, inf, e The parenthesis is not reuired for constant.
4. Operator
The operators (+, -, *, /, ^, ! and = ) execute operations between each element of numerical value, variable and function.
    Element 1+Element 2 Add Element 1 to Element 2.
    Element 1-Element 2 Subtract Element 2 from Element 1.
    Element 1*Element 2 Multiply Element 1 by Element 2.(* it is possible also to abbreviate)
    Element 1/Element 2 Divide Element 1 by Element 2.
    Element 1^Element 2 Calculate Element 1 to the power of Element 2.
    Element 1! Factorial of Element 1. (Note that the factorial operation is performed only for one element.)
    Element 1=Element 2 Substitute the operation result of Element 2 into Element 1. Therefore Element 1 must be variable.
5. Expression
The expression is composed of numerical value, variable and function, each element of which is connected by the operator. Further, the expressions can be connected by the operator as one element.
The operational order between each element follows "the operational order of expressions".
  Example) Element 1 + Element 2 - Element 3 * Element 4/Element 5 ^ Element 6! + Element 7…
    Note) Note that Element 6! is immediately followed by the operator.
6. Miscellaneous
Minus "-", excluding the exponential part of expression, is regarded as a binary operator.
  Minus "-" at the beginning of the expression or immediately after the open parenthesis or immediately after the semicolon, is considered as that the beginning of zero is abbreviated.
  Example) - a+b → (0-a) +b
    - a^b → 0- (a^b)
    a^-b → Error
    a^ (- b) → a^ (0-b)
    a*b; - a*b → a*b; 0- (a*b)
    a*-b → Error
  In order to make expression easy to see, insert the space between words.
 Order of operations in expression
1. The expression is operated in the higher priority order of the operator.
2. The operation is performed from the left side if there is more than one operator of the same priority.
3. The operation inside the parenthesis is performed with high priority.
4. Further, the parenthesis can be described inside the parenthesis. In that case, the priority is given to the inside parenthesis.
Type and priority of operator
 
Priority Operator Meaning
high





low
Function Intrinsic function
!!, !, ^ Double factorial, Factorial and Power
*, / Multiplication and Division
+, - Addition and Subtraction
= Substitution
Mistakable description example of expression.
 
1. The order of operations without parenthesis.
  2+3*4 2+(3*4) The multiplication is calculated first than the addition.
  3*4^5 3*(4^5) The power is calculated first than the multiplication.
  sin(2)^3 (sin(2))^3 The function is calculated first than the power.
  1/2i 1/(2i) The imaginary number sign takes precedence.
  3!!! (3!!)! The double factorial takes precedence from the factorial.
2. The expression without multiplication sign.
  3a It is calculated as 3*a.
  a3 × a3 is handled as variable identifier.
  a(b+c) × It is not calculated as a* (b+c). "a" is handled as user defined function.
  (a+b)(b+c) It is calculated as (a+b)*(b+c).
 Numerical value, operator and constant
     
Classification Functional name Reserved word
Numerical value Numerical value 1234567890 0 ~9
Decimal point 0.123 .
Sign -123, +456 +,-
Exponent 1.23E-45 E
Imaginary number 2+3i i
Operator Addition x+y +
Subtraction x-y -
Multiplication x*y *
Division x/y /
Power x^y ^
Factorial n! !
Double factorial n!! !!
Substitution a=123 =
Multiple expression Expression separator a=2+3; b=4/7 ;
Constant Napier's constant e= 2.71828… e
Infinity inf
Pi π= 3.14159… pi
Euler's constant γ= 0.5772… euler
Logical value true = 1, false = 0 true,false
 Elementary function
     
Classification Functional name Reserved word
Logarithm and exponential function Square root sqrt(x)
Common logarithm log log(x)
Natural logarithm ln ln(x)
Exponential ex e^x
Power xy x^y
Trigonometric function Sine sin sin(x)
Cosine cos cos(x)
Tangent tan tan(x)
Invese sine sin-1 asin(x)
Invese cosine cos-1 acos(x)
Invese tangent tan-1 atan(x)
Hyperbolic function Hyperbolic sine sinh sinh(x)
Hyperbolic cosine cosh cosh(x)
Hyperbolic tangent tanh tanh(x)
Invese hyperbolic sine sinh-1 asinh(x)
Invese hyperbolic cosine cosh-1 acosh(x)
Invese hyperbolic tangent tanh-1 atanh(x)
Combination and Permutation Combination nCr combination(n,r)
Permutation nPr permutation(n,r)
Factorial x! x!
Double factorial x!! x!!
Numerical function
(real number)
Floor function int(4.2)=4, int(-4.2)=-5 int (x)
Ceiling function ceiling(4.2)=5, ceiling(-4.2)=-4 ceiling (x)
Integer part IP(4.2)=4, IP(-4.2)=-4 IP (x)
Fractional part FP(4.2)=0.2, FP(-4.2)=-0.2 FP (x)
Remainder on division of x by y mod(9,5)=4, mod(-9,5)=1 mod (x, y)
y*FP(x/y) remainder(9,5)=4, remainder(-9,5)=-4 remainder (x, y)
Rounding x to n decimal place(s)
round(-2.34,1)=-2.3 round (x, n)
Round down x to n decimal place(s) roundup(-2.34,1)=-2.3 rounddown (x, n)
Round up x to n decimal place(s) rounddown(-2.34,1)=-2.4 roundup (x, n)
IP(x*10n)/10n truncate(-2.34,1)=-2.3 truncate (x, n)
Numerical function (complex number) Sign sign(z)=1,0,-1 sign(z)
Complex conjugate number x+iy→ x-iy conjugate(z)
Real part x+iy→ x Re(z)
Imaginary part x+iy→ y lm(z)
Absolute value |z| = |re| = r abs(z)
Complex argument reiθ→θ argument(z)
Cartesian coordinate conversion re→x+iy cartesian(z)
Cartesian coordinate conversion (r,θ) → x+iy cartesian(r,θ)
Polar coordinate conversion x+iy → re polar(z)
Polar coordinate conversion (x, y) → re polar(x, y)
 Probability function
     
Classification Functional name Reserved word
Upper cumulative distribution Q Probability density f Percentage point x Non centrality λ
Continuous distribution function Standard normal distribution normalcd(x) normalpd(x) normalicd(Q)   
Normal distribution normalcd(x,μ,σ) normalpd(x,μ,σ) normalicd(Q,μ,σ)   
Logarithmic normal distribution lognormalcd(x,μ,σ) lognormalpd(x,μ,σ) lognormalicd(Q,μ,σ)   
Chi-square distribution chi2cd(x,ν) chi2pd(x,ν) chi2icd(Q,ν)   
t-distribution of student tcd(x,ν) tpd(x,ν) ticd(Q,ν)   
F-distribution fcd(x,ν1,ν2) fpd(x,ν1,ν2) ficd(Q,ν1,ν2)   
Noncentral chi-square distribution ncchi2cd(x,ν,λ) ncchi2pd(x,ν,λ) ncchi2icd(Q,ν,λ) ncchi2il(P,x,ν)
Noncentral t-distribution nctcd(x,ν,λ) nctpd(x,ν,λ) ncticd(Q,ν,λ) nctil(Q,x,ν)
Noncentral F-distribution ncfcd(x,ν1,ν2,λ) ncfpd(x,ν1,ν2,λ) ncficd(Q,ν1,ν2,λ) ncfil(Q,x,ν1,ν2)
Uniform distribution uniformcd(x,a,b) uniformpd(x,a,b) uniformicd(Q,a,b)   
Exponential distribution exponentialcd(x,b) exponentialpd(x,b) exponentialicd(Q,b)   
Weibull distribution weibullcd(x,a,b) weibullpd(x,a,b) weibullicd(Q,a,b)   
Gamma distribution gammacd(x,a,b) gammapd(x,a,b) gammaicd(Q,a,b)   
Beta distribution betacd(x,a,b) betapd(x,a,b) betaicd(Q,a,b)   
Laplace distribution laplacecd(x,a,b) laplacepd(x,a,b) laplaceicd(Q,a,b)   
Cauchy distribution cauchycd(x,a,b) cauchypd(x,a,b) cauchyicd(Q,a,b)   
Logistic distribution logisticcd(x,α,β) logisticpd(x,α,β) logisticicd(Q,α,β)   
Discrete distribution function Poisson distribution poissoncd(x,λ) poissonpd(x,λ) poissonicd(Q,λ) poissonil(Q,x)
Binomial distribution binomialcd(x,n,p) binomialpd(x,n,p) binomialicd(Q,n,p)   
Negative binomial distribution negbinomialcd(x,k,p) negbinomialpd(x,k,p) negbinomialicd(Q,k,p)   
Geometric distribution geometriccd(x,p) geometricpd(x,p) geometricicd(Q,p)   
Hypergeometric distribution hypgeometriccd(x,n,M,N) hypgeometricpd(x,n,M,N)      
< Note > For the reserved word which uses lower cumulative probability P, add lower to the above-mentioned each reserved word end.
              Example) P=poissoncdlower (x,λ), x=poissonicdlower (P,λ), λ=poissonillower (P, x)
 Bessel function
     
Classification Functional name Reserved word
f (x) f '(x) f-1 (0), f '-1 (0), s=1,2.
Bessel function Bessel function of the 1st kind Jν(x) besselj(ν,x) besseljdf(ν,x) besseljzeros(ν,s), besseljdfzeros(ν,s)
Bessel function of the 2nd kind Yν(x) bessely(ν,x) besselydf(ν,x) besselyzeros(ν,s), besselydfseros(ν,s)
Modified bessel function of the 1st kind Iν(x) besseli(ν,x) besselidf(ν,x)   
Modified bessel function of the 2nd kind Kν(x) besselk(ν,x) besselkdf(ν,x)   
Hankel function of the 1st kind H(1)ν(x) hankelH1(ν,x) hankelH1df(ν,x)   
Hankel function of the 2nd kind H(2)ν(x) hankelH2(ν,x) hankelH2df(ν,x)   
Spherical Bessel function Spherical bessel function of the 1st kind jν(x) sphericalbesselj(ν,x) sphericalbesseljdf(ν,x) sphericalbesseljzeros(ν,s), sphericalbesseljdfzeros(ν,s)
Spherical bessel function of the 2nd kind yν(x) sphericalbessely(ν,x) sphericalbesselydf(ν,x) sphericalbesselyzeros(ν,s), sphericalbesselydfzeros(ν,s)
Modified spherical bessel function of the 1st kind iν(x) sphericalbesseli(ν,x) sphericalbesselidf(ν,x)   
Modified spherical bessel function of the 2nd kind kν(x) sphericalbesselk(ν,x) sphericalbesselkdf(ν,x)   
Spherical hankel function of the 1st kind h(1)ν(x) sphericalhankelH1(ν,x) sphericalhankelH1df(ν,x)   
Spherical hankel function of the 2nd kind h(2)ν(x) sphericalhankelH2(ν,x) sphericalhankelH2df(ν,x)   
Airy function Airy function Ai(x) airyai(x) airyaidf(x) airyaizeros(s), airyaidfzeros(s)
Airy function Bi(x) airybi(x) airybidf(x) airybizeros(s), airybidfzeros(s)
Kelvin function Kelvin function of the 1st kind, ber berν(x) ber(ν,x) berdf(ν,x)
Kelvin function of the 1st kind, bei beiν(x) bei(ν,x) beidf(ν,x)
Kelvin function of the 2nd kind, ker kerν(x) ker(ν,x) kerdf(ν,x)
Kelvin function of the 2nd kind, kei keiν(x) kei(ν,x) keidf(ν,x)
Kelvin function of the 3rd kind, her herν(x) her(ν,x) herdf(ν,x)
Kelvin function of the 3rd kind, hei heiν(x) hei(ν,x) heidf(ν,x)
 Special function
     
Classification Functional name Reserved word Extended reserved word
Gamma function Gamma function Γ(a) gamma(a)   
Lower incomplete gamma function γ(a,x) igamma1(a,x)   
Upper incomplete gamma function Γ(a,x) igamma2(a,x), gamma(a,x)   
Lower regularized incomplete gamma function P(a,x) gammap(a,x) gammapdf(a,x), gammapix(y,a), gammapia(y,x)
Upper regularized incomplete gamma function Q(a,x) gammaq(a,x) gammaqdf(a,x), gammaqix(y,a), gammaqia(y,x)
Logarithm of gamma function lnΓ(a) lngamma(a)   
Digamma function ψ(a) polygamma(a)   
Polygamma function ψ(n)(a) polygamma(n,a)   
Double factorial x!! x!!   
Pochhammer function (x)n pochhammer(x,n)   
Beta function Beta function B(a,b) beta(a,b)   
Regularized incomplete beta function Ix(a,b) ibeta(x,a,b) ibetadf(x,a,b), ibetaix(y,a,b)
Regularized incomplete beta function I1-x(a,b) ibetac(x,a,b) ibetacdf(x,a,b), ibetacix(y,a,b)
Error function Error function erf(x) erf(x) erfdf(x), erfix(y)
Complementary error function erfc(x) erfc(x) erfcdf(x), erfcix(y)
Imaginary error function erfi(x) erfi(x) erfidf(x)
Elementary function integral Exponential integral Ei(x) Ei(x)   
Exponential integral En(x) Ei(n,x)   
Logarithmic integral li(x) li(x)   
Sine integral Si(x) Si(x)   
Cosine integral Ci(x) Ci(x)   
Hyperbolic sine integral Shi(x) Shi(x)   
Hyperbolic cosine integral Chi(x) Chi(x)   
Fresnel integral Fresnel sine integral S(x) fresnelS(x)   
Fresnel cosine integral C(x) fresnelC(x)   
Elliptic integral Complete elliptic integral of the 1st kind K(k) ellipticK(k)   
Complete elliptic integral of the 2nd kind E(k) ellipticE(k)   
Complete elliptic integral of the 3rd kind Π(n,k) ellipticPi(n,k)   
Incomplete elliptic integral of the 1st kind F(x,k) ellipticF(x,k)   
Incomplete elliptic integral of the 2nd kind E(x,k) ellipticE(x,k)   
Incomplete elliptic integral of the 3rd kind Π(x,n,k) ellipticPi(x,n,k)   
Elliptic function Jacobi elliptic function sn sn(u) jacobiSN(u,k)   
Jacobi elliptic function cn cn(u) jacobiCN(u,k)   
Jacobi elliptic function dn dn(u) jacobiDN(u,k)   
Jacobi amplitude function am(u) jacobiAM(u,k)   
Orthogonal polynomial Hermite polynomial Hn(x) hermiteH(n,x)   
Chebyshev polynomial of the 1st kind Tn(x) chebyshevT(n,x)   
Chebyshev polynomial of the 2nd kind Un(x) chebyshevU(n,x)   
Legendre polynomial Pn(x) legendreP(n,x)   
Associated Legendre polynomial Pnm(x) legendreP(n,,x)   
Laguerre polynomial Ln(x) laguerreL(n,x)   
Associated Laguerre polynomial Lnα(x) laguerreL(n,α,x)   
Gegenbauer polynomial Cnλ(x) gegenbauerC(n,λ,x)   
Jacobi polynomial Pnα,β(x) jacobiP(n,α,β,x)   
Spherical harmonics Ynm(θ,φ) sphericalharmonicY(n,m,θ,φ)
Hypergeometric function Confluent hypergeometric function of the 1st kind 1F1(a;b;x) F11(a,b,x)   
Confluent hypergeometric function of the 2nd kind U(a;b;x) FU11(a,b,x)   
Gauss hypergeometric function 2F1(a,b;c;x) F21(a,b,c,x)   
Miscellaneous function Bernoulli number Bn bernoulli(n)   
Riemann zeta function ζ(x) zeta(x)   

 Programming
This programming language is a "C-language-like" simple one and specialized for numerical computation.
     
Classification Reserved word Quick instruction
Flow control if(expression) {statement;...} elseif(expression) {statement;...} else{statement;...} If the conditional expression of "if" is true, the statement is executed. If false, the statement is executed by the conditional expression of "elseif". The if statement ends after the execution of one of statements.
while(expression) {statement;...} If the conditional expression is true, the statement is executed. The statement is repeatedly executed and ends when the conditional expression becomes false.
do{statement;...} while(expression); After the statement is unconditionally executed, if the conditional expression is true, the statement is again executed. If false, the statement ends.
for(initialize; check; update) {statement;...} At first the variable is initialized, and if the conditional expression is true, the statement is executed. After the execution of the statement, the variable is incremented, the conditional expression is again evaluated, and then the same procedure described above is repeatedly executed. When the conditional expression becomes false, the statement ends.
break It escapes from a loop unconditionally.
continue It returns to the beginning of a loop unconditionally.
Display control print(expression1,expression2,...) The value of expression is outputted.
println(expression1,expression2,...) After outputting the value of expression, a new line is started.
Comment /*comment*/ It participates in neither expression nor control.
Logical operator


If a conditional expression is truth, the value is true.
If not, the value is false.
not Priority order: not>and>or
and
or
== The left expression is equal to the right expression. =
<> The left expression is not equal to the right expression. ≠
=<, <= The left expression is less than or equal to the right expression. ≦
=>, >= The left expression is greater than or equal to the right expression. ≧
< The left expression is less than the right expression. <
> The left expression is greater than the right expression. >
Logical value
true true=1(≠0)
false false=0

   Contact us     Terms of use    About us      All Rights Reserved, Copyright (C) CASIO COMPUTER CO., LTD.