Question What data type for decimals?

Cheetah

Well-known member
Joined
Oct 12, 2006
Messages
232
Programming Experience
Beginner
Hi there,

I am trying to work out ( 6 / 7) but it always comes to 0.0 when i use double as the datatype.

So what datatype should i use?

Thanks.
 
try (6.0/7.0) I think it should work. 6 is an integr also 7 is also an integer. By make 6.0 ,7.0 they are the float numbers
 
try (6.0/7.0) I think it should work. 6 is an integr also 7 is also an integer. By make 6.0 ,7.0 they are the float numbers

Actually, that would make them doubles. 6.0F/7.0F would make them float(single). No matter, though, as if you read the last post you would see his problem was fixed.
 
Back
Top