3.3-Working with Binary Arithmetic Operators Flashcards

1
Q

📝️ What is a binary operator?

A

A binary operator is an operator that operates on two operands and manipulates them to return a result.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

📝️ What is the binary operator’s syntax?

A

operand1 BI-OPERATOR operand2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

📝️ What are the Arithmetic operators and its precedence?

A
  • > Multiplication Operator *
  • > Division Operator /
  • > Remainder Operator %
  • > Addition Operator +
  • > Substraction Operator -

⚠️The multiplicative operators (*, /, %) have a higher order of precedence than the additive ones (+, -)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does the Modulus Operator return?

A

It returns the remainder when two numbers are divided.

🧠️🤯️⚠️📣️ Be sure to understand the difference between arithmetic division and modulus.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

📝️ What does the expression floor value means?

A
  • > For integer values, division results in the floor value
  • > It just means the value without anything after the decimal point.

👀️ e.g: The floor value is 4 for each of the values 4.0, 4.5, and 4.9999999.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

🧠️🤯️⚠️📣️ What does Numeric promotion means?

A

🚀️ When applying an arithmetic operator ( +|-||/|% ) the result type promotes to int by default**
🚀️ If either operand is long|float|double type, the result is converted to long|float|double

How well did you know this?
1
Not at all
2
3
4
5
Perfectly