Returns the integer part of a real number

Hello,

I need to know an integer value as part of a real number, like this:

double a = 0;

double x = 0;

x = 1500.00;

a = (x / 1000);

now "a" must be equal to 1.

Pascal has a function INT (a = INT(x/1000)), and what about java ?

Thanks for help,

guido

[313 byte] By [3103572001a] at [2007-11-27 2:39:31]
# 1

> Hello,

> I need to know an integer value as part of a real

> number, like this:

> double a = 0;

> double x = 0;

>x = 1500.00;

> a = (x / 1000);

> now "a" must be equal to 1.

> Pascal has a function INT (a = INT(x/1000)), and what

> about java ?

It is almost the same thing.

double d = 1.5;

int i = (int) d;

tjacobs01a at 2007-7-12 3:01:35 > top of Java-index,Java Essentials,Java Programming...
# 2
o_OShould we expect your 2nd question around March of 2013?
KelVarnsona at 2007-7-12 3:01:35 > top of Java-index,Java Essentials,Java Programming...
# 3
What do you mean ...?The answer was enough, thank you.Best regards,guido
3103572001a at 2007-7-12 3:01:35 > top of Java-index,Java Essentials,Java Programming...
# 4
It has your registered date listed as May 27, 2001 and that this was your first post. It just seemed a bit unusual to register and then wait almost 7 years before posting.I was just having some fun. No offense intended.
KelVarnsona at 2007-7-12 3:01:35 > top of Java-index,Java Essentials,Java Programming...
# 5
OK, I don't feel offended.It's my first post, because when I have a problem, I read documentation.Simply it didn't come to my mind...guido
3103572001a at 2007-7-12 3:01:35 > top of Java-index,Java Essentials,Java Programming...
# 6
> It's my first post, because when I have a problem, I> read documentation.My sincerest and warmest congratulations on knowing how to do your job. Judging by 99.5% of the remainder of the posters here, you are member of a very small elite.
ejpa at 2007-7-12 3:01:35 > top of Java-index,Java Essentials,Java Programming...