Note: You are currently viewing documentation for Moodle 3.3. Up-to-date documentation for the latest stable version of Moodle is probably available here: Formulas: Operators.

Formulas: Operators: Difference between revisions

From MoodleDocs
(Created page with "{{Formulas question type}} ==Operators== Numerical operators available in the Formulas question type are listed in the table below. They are equivalent to those correspondin...")
 
(Redirected page to Formulas question type)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Formulas question type}}
#REDIRECT [[Formulas_question_type]]
 
==Operators==
 
Numerical operators available in the Formulas question type are listed in the table below. They are equivalent to those corresponding in JavaScript. For more details on these operators, see for example [http://www.w3schools.com/jsref/jsref_operators.asp w3schools/jsref/jsref_operators].
 
{| class="nicetable"
|-
! Operator
! Definition
|-
| colspan="2" | ''Arithmetic Operators''
|-
| +
| addition
|-
| -
| subtraction
|-
| *
| multiplication
|-
| /
| division
|-
| %
| modulus (division remainder)
|-
| colspan="2" | ''Assignment Operators''
|-
| =
| assigns a value to a variable
|-
| colspan="2" | ''Comparison Operators''
|-
| ==
| equal to
|-
| !=
| not equal
|-
| >
| greater than
|-
| <
| less than
|-
| >=
| greater than or equal to
|-
| <=
| less than or equal to
|-
| colspan="2" | ''Conditional (Ternary) Operator''
|-
| ? :
| conditional operator
|-
| colspan="2" | ''Logical Operators''
|-
| &&
| and
|-
| | |
| or
|-
| !
| not
|-
| colspan="2" | ''Bitwise Operators''
|-
| &
| AND
|-
| &#124;
| OR
|-
| ~
| NOT
|-
| ^
| XOR<br>(Note that ^ means "power" in algebraic formulas)
|-
| <<
| left shift
|-
| >>
| right shift
|}
 
 
[[#top|Back to top of page]]
 
[[Formulas_question_type|← FORMULAS QUESTION TYPE]]

Latest revision as of 00:59, 1 February 2018