division returning an integer

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

division returning an integer

Rafael Carazo-Salas
Hi all a VERY very basic question .  How can I perform a division that
will return to me the integer result of it for example return 22 when I
divide 45 by 2 and where can I find a manual that answers this sort of
reall basic questions for ImageJ ?  Thank you in advance .





Rafael
Reply | Threaded
Open this post in threaded view
|

Re: division returning an integer

Mikhail Umorin
int a = 45/2; // ("//" means comment) = 22

this is a feature of Java that when you divide two integers and assign the
result to an integer it performs integer division

On Monday 05 September 2005 10:12, Rafael Carazo-Salas wrote:

> Hi all a VERY very basic question .  How can I perform a division that
> will return to me the integer result of it for example return 22 when I
> divide 45 by 2 and where can I find a manual that answers this sort of
> reall basic questions for ImageJ ?  Thank you in advance .
>
>
>
>
>
> Rafael
Reply | Threaded
Open this post in threaded view
|

Re: division returning an integer

Filip Rooms
In reply to this post by Rafael Carazo-Salas
On 9/5/05, Rafael Carazo-Salas <[hidden email]> wrote:
> Hi all a VERY very basic question .  How can I perform a division that
> will return to me the integer result of it for example return 22 when I
> divide 45 by 2 and where can I find a manual that answers this sort of
> reall basic questions for ImageJ ?  Thank you in advance .

Since Java is much like C (at least for these basic instructions) and C++, you
could try any programming tutorial on these languages. Some interesting
reference under *nix systems (linux, unix, irix, ...) are the man
pages. Then you can type
"man sin" and get information how to use the sine function...

An interesting link is http://www.mindview.net/Books/TIJ/, where the
free e-book "Thinking in Java" by Bruce Eckel can be downloaded.

Kind regards,

Filip Rooms