Concentric
Expert Member
- Joined
- Feb 16, 2017
- Messages
- 1,028
- Reaction score
- 197
if i have:
float x;
x=2/5;
the value of x is given as 0.
but if x=2.0/5.0 then x=0.4
why?
I tested a couple other fractions without .0 and it seems like the numerator must be greater than the denominator otherwise a value of 0 is returned.why is this so?
Thanks
float x;
x=2/5;
the value of x is given as 0.
but if x=2.0/5.0 then x=0.4
why?
I tested a couple other fractions without .0 and it seems like the numerator must be greater than the denominator otherwise a value of 0 is returned.why is this so?
Thanks
