Complex calculation syntax

Parent Previous Next

A complex calculus is allowed to use operators + (addition), - (subtraction), * (multiplication), / (division), ^ (power of a number), ² (square), (by priority decreasing priority order).

To be noticed : Operators must be written and spaces are allowed. No implicit multiplication is allowed.

Parenthesis may be used.

Function arguments must lay between braces.


The predefined complex functions are :


abs

Module of a complex. Result is a complex number of imaginary part 0.

conj

Complex conjugate.

angle

Returns  a complex number imaginary part of which is zero and real part of which is principal argument of the complex given as argument.

re

Returns  a complex number imaginary part of which is zero and real part of which is the real part of the complex given as argument.

im

Returns  a complex number imaginary part of which is zero and imaginary part of which is the real part of the complex given as argument.

sqrt

Square root. If the argument is not real or is strictly negative, the result doesn't exist.

int

Integer part. If the argument is not real, the result doesn't exist.

sin

complex sine.

cos

complex cosine.

tan

complex tangent.

ln

complex neperian logarithm.

exp

complex exponential.

asin

arcsine.  If the argument is not real, the result doesn't exist.

acos        

arcsine.  If the argument is not real or doesn't lay between -1 and 1, the result doesn't exist.

atan

arctangent. If the argument is not real, the result doesn't exist.

cosh

Hyperbolic cosine

sinh

Hyperbolic sine

tanh

Hyperbolic tangent

asinh

Hyperbolic arcsine. If the argument is not real, the result doesn't exist.

acosh

Hyperbolic arccosine.If the argument is not real is strictly inferior to 1, the result doesn't exist..

atanh

Hyperbolic arctangent. If the argument is not real or doesn't lay strictly between -1 and +1, the result doesn't exist.

rand

Returns a complex number containing a real value which is a pseudo-random real number lying between 0 and 1 (0 excluded and 1 included).

²

Square.

fact(z)

returns z !.

z  must be real, integer, positive or null.

left(z)

If z is a calculation containing a test or an operation, returns the left member. Otherwise the calculation containing this formula will return the same calculation as z.

right(z)

If x is a calculation containing a test or an operation, returns the right member. Otherwise the calculation containing this formula will return the same calculation as x.



The predefined complex functions of two variables are :


max(z, z')

returns the greater number of z and z'. z and z' must be real.

min(z, z')

returns the lowest number of z and z'. z and z' must be real.

pgcd(z, z')

returns the GCD of z and z'. z and z' must be real, integer positive and not null.

ppcm(z, z')

returns the LCM of z and z'. z and z' must be real, integer positive and not null.

mod(z, z')

returns the rest of the integer division of z by z'. z and z' must be real and integer  positive with  b not null.

ncr(z, z')

returns the number of subsets of z' elements in a set of z elements.

z and  z' must be real, integer positive with z' lower or equal to z.

npr(z, z')

returns the number of permutations of z' elements in a set of z elements.

z and  z' must be real, integer positive with z' lower or equal to z.


The predefined functions of three variables are :


if(cond, x, y)

returns x if cond  equals 1 and y otherwise.


The predefined functions of four variables are :


integral(expr, var, a, b)

returns an appoximated value of the integral of expr between a and b, var is the variable of integration.

a and b must be real.

The integral is calculated through Simpson's method with 400 intervals.

primitive(expr, var, a, b)

expr is a function of variable var. Returns f(b) - f(a).


The predefined functions of five variables are :


sum(expr, var, start, end, step)

returns sum of expression expr when all integer values in the range start-end with an increment of step are given to variable var.

expr may use all values or functions already defined.

start, end and step must have integer values.

prod(expr, var, start, end, step)

returns product of expression expr when all integer values in the range start-end with an increment of step are given to variable var  .

expr may use all values or functions already defined.

start, end and step must have integer values.


The tests: In complex calculus,the test exist only if the two arguments are real. They return a complex value which is 1 when the result is true, zero otherwise.


       a > b        return 1 if a > b and zero otherwise.

       a < b        return 1 if a < b and zero otherwise.

       a >= b        return 1 if a >= b and zero otherwise.

       a <= b        return 1 if a <= b and zero otherwise.

       a = b   return 1 if a = b and zero otherwise.

       a <> b  return 1 if a is not equal to b and zero otherwise.


Boolean operators :


       a&b : Returns 1 if a = 1 et b = 1 and 0 otherwise.

       a|b : Returns 1 if a = 1 ou b = 1 et 0 otherwise.