Equation Expressions in Kst
Prev
Next

Appendix G. Equation Expressions in Kst

Table of Contents

Operators
Arithmetic Operators
Logical and Relational Operators
Built-in Functions
Built-in Variables
Built-in Constants

Kst equations are expressed in terms of built in operators, functions, constants, scalars and vectors in the current Kst session.

Some rules should be noticed when you enter equation expressions in either UI textbox or KstScript:

The following is a list of all built-in operators, functions and constants used to express Equations in Kst.

Operators

Arithmetic Operators

+

Addition operator

-

Subtraction operator

*

Multiplication operator

/

Division operator

%

Remainder operator

^

Raise to power operator

Logical and Relational Operators

Logical operators are used to evaluate expressions to true(1) or false(0) value. In Kst, 0 is false, and all other numbers represent true value.

&

Bitwise And operator

It compares the corresponding bits of two operands in their binary representation of equal length. If both values of the pair are 1, the resulting bit value is 1, 0 otherwise.

|

Bitwise Or operators.

It compares the corresponding bits of two numbers in their binary representation of equal length. If both values of the pair are 0, the resulting bit is 0, 1 otherwise.

&&

Logical operator And.

It takes two numbers as boolean variables, and results 1 (true) if both operands are non-zero, 0 (false) otherwise. See an example below.

ExpressionResults
1 && 31
3 && 00

||

Logical Or operators

It takes two operands and results 0 (false) if both operands are 0, 1 (true) otherwise. See an example below

ExpressionResults
2 || 01
2 || 11
0 || 00
!

Logical not

<

Less than

<=

Less than and equal to

==

Equal to

>

Greater than

>=

Greater than and equal to

!=

Not equal to

Prev
Next
Home


Would you like to make a comment or contribute an update to this page?
Send feedback to the KDE Docs Team