HyperCrash

Operators — Introduction

Operators — Introduction

Previous topic Next topic No expanding text in this topic  

Operators — Introduction

Previous topic Next topic JavaScript is required for expanding text JavaScript is required for the print function  

The operators of the Safety Tool are like subroutines or functions in a programming language: they yield results which may be further used to produce some new results, etc.

 

Table 2: List of arithmetic operators (in order of decreasing precedence), arithmetic arguments, arithmetic result.

Name

Description

^

power

-

unary hc_img46

*

multiplication

/

division

%

modulo (integer arguments)

+

addition

-

subtraction

 

Table 3: List of comparison operators (in order of decreasing precedence), arithmetic arguments, logical result.

Name

Description

hc_img47

greater than

hc_img48

less than

hc_img49

greater or equal than

hc_img50

less or equal than

hc_img51

equal to

hc_img52

not equal to (C style)

hc_img53

not equal to (PASCAL style)

 

Table 4: List of logical operators (in order of decreasing precedence), logical arguments, logical result.

Name

Description

hc_img54

logical AND

hc_img55

logical OR

 

Table 5: List of predefined mathematical functions (floating point or integer argument, floating point result).

Name

Description

sin

sine

cos

cosine

tan

tangent

asin

arc sine

acos

arc cosine

atan

arc tangent

ln

natural logarithm

log

base 10 logarithm

exp

exponent (hc_img45 power argument)

sqrt

square root

abs

absolute value

cbrt

cubic root

sinh

hyperbolic sine

cosh

hyperbolic cosine

tanh

hyperbolic tangent

asinh

inverse hyperbolic sine

acosh

inverse hyperbolic cosine

atanh

inverse hyperbolic tangent

As was stated at the beginning of the paragraph devoted to the tool's command language, the actions that may be applied to an object depend on this object's type. That is why the existing operators will be listed together with their argument lists and result types.

The simplest operators, acting on scalar type objects are listed in Tables 2 through 5.

There are two categories of operations: operators and instructions. The first ones yield a result computed using their operands. The second ones have a global action (such as output) or modify (some of) their operands.

Finally, some operators (or instructions) can have several syntaxes. The operation to be executed is deduced in such a case from the type and the number of operands. This note applies to arithmetic operators (number hc_img56 number, number hc_img56 vector) and to complex operators as well (for example, the NEW_LINE Operator).

See the Batch Language Reference Manual for the description of the syntax of all operators and instructions.