Difference between revisions of "Expressions"
m |
m |
||
Line 7: | Line 7: | ||
:<code>(-B + Sqrt(B^2 - 4*A*B))/(2*A)</code> | :<code>(-B + Sqrt(B^2 - 4*A*B))/(2*A)</code> | ||
− | You use expressions in the Definition of a Variable or Function to say how to calculate. An expression can be simply a literal number | + | You use expressions in the Definition of a Variable or Function to say how to calculate. An expression can be simply a literal [[Numbers|number]], including [[Boolean or truth values|Boolean]] or [[Date and Time Values|date]], a [[Text values|text value]], or an identifier of a variable. Or it could be an arithmetic [[Operators|expression, a comparison or logical expression]], [[IF a THEN b ELSE c]], or a [[Function calls and parameters|function call]], such as <code>Sqrt(B)</code>. |
− | + | Analytica is primarily a [[Declarative language]], where the Definition of each variable is a simple expressions. But Analytica does support constructs used in common procedural or imperative languages like Python or C++, including <code>BEGIN ... END </code> statements, [[For]] and [[While]] loops, local variables, assignments, references and data Structures, and handles to objects. See [[Procedural Programming]] for details. | |
==Sections== | ==Sections== |
Latest revision as of 02:26, 13 October 2017
This section explains how to write expressions in the Analytica language, such as
(-B + Sqrt(B^2 - 4*A*B))/(2*A)
You use expressions in the Definition of a Variable or Function to say how to calculate. An expression can be simply a literal number, including Boolean or date, a text value, or an identifier of a variable. Or it could be an arithmetic expression, a comparison or logical expression, IF a THEN b ELSE c, or a function call, such as Sqrt(B)
.
Analytica is primarily a Declarative language, where the Definition of each variable is a simple expressions. But Analytica does support constructs used in common procedural or imperative languages like Python or C++, including BEGIN ... END
statements, For and While loops, local variables, assignments, references and data Structures, and handles to objects. See Procedural Programming for details.
Sections
- Numbers
- Date and Time Values
- Boolean or truth values
- Text values
- Operators
- IF a THEN b ELSE c
- Function calls and parameters
- Math functions
- Numbers and text
- INF, NAN, and NULL - Exception values
- Warnings
- Datatype functions
See Also
- Expression Syntax
- Parsed Expressions
- Expression Assist
- The Expression popup menu
- Tutorial: Using local variables and indexes in an expression
Enable comment auto-refresher