When we required evaluating basic mathematical expressions then we required to use asthmatic operators.
Arithmetic operators are of 2 types -
Unary arithmetic operators ++, --
Binary arithmetic operators +, -, *, /, %
Binary Arithmetic Operators
When we are working with these operators we required 2 operands. If any one of the asg. Is missing it gives an error.
In implementation when we are evaluating any expression if that expression contains multiple operators then in order to evaluate that expression we requires to follow priority of the operator.
According to priority which operators are having highest priority it should be evaluate first, which operator contains least priority it should be evaluated at last?
When equal priority is occurred, if it is binary left to right, if it is unary, right to left required evaluating.
When we are working with +, - symbols then it works like a binary and unary operator also.
if the symbol is available before the operands then it is unary operators which indicate sign of the value.
When the symbol is available after the operands then it is binary arithmetic operators .Which requires 2 arguments.
Always expression required to evaluate acc. To operand type only.
Always operator behaviour is operand depend only i.e. what type of data we are passing depends only on input type it works.
If both arguments are integer then return value is int.
Any one of the argument is float or both are float then return value is float type only.
Output sign will depends on numerator value sign and determinate value also i.e. if any of the arguments is negative then return value is negative, if both arguments are return value is positive.
In division operator when the numerator value is less than of denominator operator then return value is zero if both are integer.