first time I'v posted here but I must know what's wrong with this simple peace of code:
#include <iostream> using namespace std; int main() { double test = (1 / 2) * 2; cout << test << endl; return 0; } when ever I run this the code it displays 0, should I be casting something, it happens regardless of what compiler I use and it returns even stranger results if the '1' is divided be some form of decimal.
ints. And by default, all numbers areints.