Or it might be windows or processor to be more accurate...
Everything went fine, but suddenly I got weird results from DBP. It turned out that it couldnt divide two normal nubers and get proper decimal, for example dividing 11 with 2:
x# = 11/2
print x#
wait key
gives me 5. Reinstall (with fragramented HD and cleaned registery) didnt help.
Ok, I thought and made similar program with C++:
#include <windows.h>
#include <iostream.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
float i = 11/2;
float x = 10/3;
cout << i << endl << x << endl;
getchar ();
return 0;
}
Dividing 11 with 2 gives 5, 10 with 3 gives 3...
Ok, what about Java:
public class floats {
public static void main(String[] args) {
float i = 11/2;
double x = 10/3;
System.out.println("i: " + i + " x: " + x);
}
}
I get 5.0 and 3.0
Everything else works, trying same with windows' calculator gives me proper results, but programming languages dont work. Weird.
I have XP home, fragramented HD, cleaned registery, scandisked and everything. My computer is still somehow new, Intel Pentium 4 HT 2,8Ghz so I think it's not likely my math processor exploded.
Any ideas?