- #1
Lord Anoobis
- 131
- 22
- Homework Statement
- Write a program that asks for the starting time and the number of minutes of the call,
and... pretty straightforward
- Relevant Equations
- None. Checked with both MS Visual Studio and DEV C++.
So I used this statement,
where the variable was declared as float. What is strange is that it didn't execute for call_time = 6.59, but for some other values, like
the end value of the range does not cause any issues. However, when I changed the declaration to type double, the issue disappeared entirely. Why is this happening?
C++:
if (call_time > 0 && call_time <= 6.59)
C++:
if (call_time > 0 && call_time <= 2.59)