5 mathematical functions, Mathematical functions -6 – ElmoMC SimplIQ Software Manual User Manual

Page 24

Advertising
background image

SimplIQ

Software Manual

The Interpreter Language

MAN-SIMSW (Ver. 1.4)

4-6

Operator /

Description

Nota-

tion

No. of

Arguments

Output

Type

Examples

Logical OR:
Result is 1 if any
argument is
nonzero, 0 if both
are zero *

||

2 0

or

1

1||0

yields 1

0||0

yields 0

Logical NOT:
Result is 1 if
argument is zero;
otherwise it is 0*

!

1 0

or

1

!4

yields 0

!0

yields 1

!0.0004

yields 1

Unary minus:
Result is negative
if argument is
positive, and vice
versa*

-

1 Same

as

argument

-4.5

yields -4.5

-4

yields -4

(-4)

yields 4

-5+5

yields 0

Bitwise left shift:
Shifts 1st operand
left by number of
positions the 2nd
operand specifies*

<<

2 32-bit

long

integer

8<<2

yields 32

Bitwise right shift:
Shifts 1st operand
right by number of
positions the 2nd
operand specifies*

>>

2 32-bit

long

integer

8>>2

yields 2

* The arguments are truncated to integers before evaluation.

Table

4-2: Operator Details

4.2.5

Mathematical Functions

The following table lists the built-in mathematical functions of the

SimplIQ

Interpreter

language. Function names are case sensitive.

Operator Description Returns

sin

Sine Floating

point

cos

Cosine Floating

point

abs

Absolute value
Note:
The absolute value of an input argument of
hexadecimal 0x80,000,000 exceeds the long
value range and will therefore be limited to
the maximum long value for positive
numbers.

Same type as input argument

sqrt

Square root, or zero if argument is negative

Floating point


Advertising