INCLAN: Expressions: Difference between revisions

From CYANA Wiki
Jump to navigation Jump to search
(Created page with 'The command interpreter can evaluate general Fortran-77 integer, real, complex, logical and character expressions. Expressions can appear in eval statements, as conditions of if …')
 
No edit summary
Line 1: Line 1:
The command interpreter can evaluate general Fortran-77 integer, real, complex, logical and character expressions. Expressions can appear in eval statements, as conditions of if statements, as command parameters when a numeric value is expected, and as substring and element index expressions.
The command interpreter can evaluate general Fortran-77 integer, real, complex, logical and character expressions. Expressions can appear in eval statements, as conditions of if statements, as command parameters when a numeric value is expected, and as substring and element index expressions.
An expression is built according to the rules of Fortran-77 from constants, variables, and function calls. These basic items can be combined by operators (“+”, “–”, “*”, “/”, “**”, “.eq.”, “.ne.”, “.lt.”, “.le.”, “.ge.”, “.gt.”, “.and.”, “.or.”, “.not.”, “.eqv.”, “.neqv.”, “==”, “!=”, “<”, “<=”, “>=”, “>”) and grouped by parentheses.  
An expression is built according to the rules of Fortran-77 from constants, variables, and function calls. These basic items can be combined by operators (“+”, “–”, “*”, “/”, “**”, “.eq.”, “.ne.”, “.lt.”, “.le.”, “.ge.”, “.gt.”, “.and.”, “.or.”, “.not.”, “.eqv.”, “.neqv.”, “==”, “!=”, “<”, “<=”, “>=”, “>”) and grouped by parentheses.  
There are the following differences to the rules of Fortran-77:
There are the following differences to the rules of Fortran-77:
• The data type “double precision” is not supported.
• The data type “double precision” is not supported.

Revision as of 22:34, 12 August 2009

The command interpreter can evaluate general Fortran-77 integer, real, complex, logical and character expressions. Expressions can appear in eval statements, as conditions of if statements, as command parameters when a numeric value is expected, and as substring and element index expressions.

An expression is built according to the rules of Fortran-77 from constants, variables, and function calls. These basic items can be combined by operators (“+”, “–”, “*”, “/”, “**”, “.eq.”, “.ne.”, “.lt.”, “.le.”, “.ge.”, “.gt.”, “.and.”, “.or.”, “.not.”, “.eqv.”, “.neqv.”, “==”, “!=”, “<”, “<=”, “>=”, “>”) and grouped by parentheses.

There are the following differences to the rules of Fortran-77: • The data type “double precision” is not supported. • The data type “logical” is represented by the integer values 0 (false) and 1 (true). Any integer expression can be used in place of a logical expression, with 0 representing “false”, and all other values representing “true”. • Variable, function and operator names are case sensitive. The names of logical operators and intrinsic functions must be written in lower case. • The logical operators “==”, “!=”, “<”, “<=”, “>=”, “>”, “&&”, “||”, and “!” can be used in place of its respective FORTRAN-77 equivalents “.eq.”, “.ne.”, “.lt.”, “.le.”, “.ge.”, “.gt.”, “.and.”, “.or.”, and “.not.”. • All Fortran-77 intrinsic functions (except “dble”, “dprod”, “lge”, “lgt”, “lle” and “llt”) are available by their generic names but not under special names. For example, the absolute value function is known by the name “abs” but not by the special names “iabs” or “cabs”. • There are additional intrinsic functions (see below). • Blanks can only appear at “reasonable” places but not within numbers, variable names, etc. There must be no blanks between the name of a function and the opening parenthesis of its parameter list.