Understood Expressions

docs.kde.org
Search

Chapter 5. Understood Expressions

The Fung-Calc recognizes several functions, operators, and constants. Following is a complete description of each of these.

Operators

Expressions can be created using the following operators in this order of precedence:

( )

expressions in parentheses first

-A

unary minus

A^B

exponentiation (A raised to the power B)

A*B A/B A%B

multiplication, division and modulo

A+B A-B

addition and subtraction

A=B A<B A>B

comparison between A and B (result is either 0 or 1)

Note that the '=' comparison can be inaccurate due to floating point precision problems (eg. "sqrt(100)=10" probably returns 0, not 1).

A&B

result is 1 if int(A) and int(B) differ from 0, else 0.

A|B

result is 1 if int(A) or int(B) differ from 0, else 0.

KDE Logo