Simple binary operators
- A binary operator is simply any operator in maths which takes two inputs and
produces an output.
- Usually, there’s a symbol representing the operator, placed between the two
inputs.
Examples of binary operators
- Addition (
+): Takes two numbers and produces their sum.
- subtraction (
-): Takes two numbers and produces their difference.
- multiplication (
*): Takes two numbers and produces their product.
- riscv/division|division (
/): Takes two numbers and produces their quotient (‘what they
divide to make’).
- Exponentiation/powers (
^ or **): Takes a base number and an exponent,
producing the base raised to the power of the exponent.
- Example:
2^3 = 8 (2 raised to the power of 3)
- modulus (
%): Takes two numbers and produces the remainder of the riscv/division|division
- Example:
10 % 3 = 1 (10 divided by 3 leaves a remainder of 1)
Sets
- The input values come from an initial set, call it S.
- IF the output value is also always in the same set S, then we say that the
set is closed under that operation.
- S doesn’t have to be a finite set, just needs to be defined somehow.
Inlinks
pageindex
Outlinks
riscv/division