Ask your own question, for FREE!
Computer Science 17 Online
shalwing77:

double dNum = 2.02; & int iNum = (int)15.89;

shalwing77:

@ultrilliam

AYOAJ:

What are you trying to ask here? I'm a bit confused.

Kyrin:

@ayoaj wrote:
What are you trying to ask here? I'm a bit confused.
Same

Extrinix:

What programming language are you trying to show us? To me it looks like Java, but I'm unsure of it.

SmokeyBrown:

I'll assume that the "&" isn't part of the code and just meant to connect the two lines, so this could be Java... But regardless of the programming language, it's clear that these are variable declarations; the first is for a double numerical datatype, and the second is for an integer numerical datatype. I should also note that the integer variable, "iNum", will be truncated down from 15.89 to just 15. This is because the "(int)" before the number casts the double value of 15.89 into an integer form, 15. For Java, at least (not sure about other languages), casting a double or a float as an integer works by simply removing the decimal portion, by default--I think there are ways to set it to round up or down, but that's not what's happening here. Anyway, I hope some of that information is helpful, but it's difficult to say, since you didn't really include a question. Consider updating your post with more information relevant to the actual question :)

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!