Elmo HARmonica Logical not, Unary Minus, Bitwise Left Shift and Right Shift operators

Models: HARmonica HARSFEN0602

1 220
Download 220 pages 51.63 Kb
Page 26
Image 26

HARSFEN0602ElmoHARmonicaSoftwareManual

PRELIMINARYDRAFT

 

 

 

 

 

Notation

 

 

 

Description

Logical OR. The result is 1 if any of the arguments is nonzero, 0 if both are zero.

 

 

The arguments are not truncated to integers before evaluations

 

Number of

2

 

 

 

arguments

 

 

 

 

Output type

0 or 1

 

 

Example

1

0 yield 1

 

 

 

0

0 is 0.

 

 

4.2.4.18Logical NOT

Notation

!

Description

Logical NOT. The result is 1 if the argument is zero, and 0 else

 

The arguments are not truncated to integers before evaluations

Number of

1

arguments

 

Output type

0 or 1

Example

!4 yields 0

 

!0 yields 1

 

!0.0004 yields 1

4.2.4.19Unary Minus

Notation

-

Description

Unary MINUS. The result is negative if the argument is positive, and vise

 

versa.

 

The arguments are not truncated to integers before evaluations

Number of

1

arguments

 

Output type

The same as argument

Example

-4.5 yields –4.5

 

-4 yields –4

 

(-4) yields 4

 

-5+5 yields 0

4.2.4.20Bitwise Left Shift and Right Shift operators

Notation

<< or >>

Description

The bitwise shift operators shift their first operand left (<<) or right (>>) by the

 

number of positions the second operand specifies.

 

The arguments are truncated to integers before evaluations.

Number of

2

arguments

 

Output type

32 bit long integer.

Example

8>>2 yields 2

 

8<<2 yields 32

4.2.5Mathematical functions

The following table presents the mathematical built-in functions of the language.

Function names are case sensitive.

Operator

Description

Returns

 

 

 

24

Page 26
Image 26
Elmo HARmonica, HARSFEN0602 Logical not, Unary Minus, Bitwise Left Shift and Right Shift operators, Mathematical functions