# Thread: Accuracy changes under different modes

1. ## Accuracy changes under different OS modes

Hello everyone. I had created a program to simulate the motion of a projectile. My problem is that when I run the program under Windows, I get less accurate results than when I run it under DOS. Why is it so?

2. Hello again. Actually my problem really appears to be independent of the source code. The fact is that the same executable when running under DOS gives different results from those that come when the program runs under Windows. I am unable to understand why this should happen. Perhaps I can just explain the logic of the program instead of writing new code.

The program attempts to simulate the motion of a projectile fired close to a planet's surface(i.e. acceleration due to gravity can be approximated as a constant) neglecting air resistance, using the equation of a projectile, which happens to be a parabola. Now, the total time delay between the starting and ending of the simulation should be the same as the theoretically calculated value for time of flight(assuming a time compression factor of 1). Both results are shown in the program, along with the deviation from the theoretical result, after the simulation has ended.

An example of input could be as follows...
Initial speed : 60
Angle of inclination : 45
Acceleration due to gravity : 9.81 (for Earth)
Initial height : 0
Time Compression Factor : 1

When run under Windows(Windows 98 in my case)...
Theoretical time of flight : 8.64s
Actual time of flight(i.e. computed by the program) : 7.49s

When run under DOS(i.e. if the computer is started in the DOS command line mode)
Theoretical time of flight : 8.64s
Actual time of flight(i.e. computed by the same program) : 8.52s

I am unable to understand why there should be a difference between the two values of actual time of flight. In other words, why should this time delay depend on the mode in which the program is executed.
It might seem small here, but for other sets of input values, this difference turns out to be phenomenal.

I hope this information is sufficient.

3. Hello again. It seems we have been going around in circles, but I guess your last post has answered my question. Yes, the compiler is indeed an "old fossil", but it seems to be the only compiler I know of which supports DOS BGI graphics, and it happens to be the one we use at college. So no choice there. Any ideas about a newer compiler which has an IDE, and similar features?

4. get borland commandline tools 5.5

actually, i use notepad myself as i dont like /find IDEs that useful,
(they're very complicated for their purpose)
at least, for the programs that i write.