Thursday, March 22, 2012

Simple double calculation not working

Hi

double test = 10 / 20;

results in 0 ?

What am I doing wrong?

Same with float..

Hi,

try it like this:

double test = (double)10 / 20;

Grz, Kris.

0 comments:

Post a Comment