Operator’s matching [closed]
Operator’s matching [closed]
What is the result of 2.5/5, in c++? If it’s matched to the + operator of double values, it’ll be 0.5; if it’s matched to + of integers, It will be 0.
2.5/5
+
0.5
+
0
What is the rule of matching and hence conversion of the operands, for c++ arithmetic operators?
Is it defined or up to different compilers’ choices?
This question appears to be off-topic. The users who voted to close gave this specific reason:
If it's simple, you should be able to post the code.
– Neil Butterworth
Jul 1 at 18:18
By tomorrow, unfortunately, this question will be closed. See the stackoverflow.com help center's article for preparing a Minimal, Complete, and Verifiable example, and make sure that your replacement question meets all requirements.
– Sam Varshavchik
Jul 1 at 18:20
When posting technical questions on a technical site, always be sitting in front of the machine that hosts the software the question is about. Otherwise you are wasting your time, and more importantly ours.
– Neil Butterworth
Jul 1 at 18:21
Feel free to look at any C++ book on this list.
– Sam Varshavchik
Jul 1 at 18:35
Please edit your question to provide a Minimal, Complete, and Verifiable example.
– Baum mit Augen
Jul 1 at 18:16