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...")
 
No edit summary
Line 93: Line 93:


[[Formulas_question_type|← FORMULAS QUESTION TYPE]]
[[Formulas_question_type|← FORMULAS QUESTION TYPE]]
===In other languages===
[https://docs.moodle.org/all/es/Tipo_de_pregunta_f%C3%B3rmulas Español]<br>
[https://docs.moodle.org/3x/fr/Formules:_Opérateurs Français]

Revision as of 00:07, 7 January 2018


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 w3schools/jsref/jsref_operators.

Operator Definition
Arithmetic Operators
+ addition
- subtraction
* multiplication
/ division
% modulus (division remainder)
Assignment Operators
= assigns a value to a variable
Comparison Operators
== equal to
!= not equal
> greater than
< less than
>= greater than or equal to
<= less than or equal to
Conditional (Ternary) Operator
? : conditional operator
Logical Operators
&& and
| or
! not
Bitwise Operators
& AND
| OR
~ NOT
^ XOR
(Note that ^ means "power" in algebraic formulas)
<< left shift
>> right shift


Back to top of page

← FORMULAS QUESTION TYPE

In other languages

Español
Français