
-----------------------------------
kevin Noronha
Sat Mar 08, 2008 8:29 pm

booleans
-----------------------------------
umm...anyone know how i can check, if when i divide 2 integers, if they are integers or not?

here is the code

import java.util.*;

class Factors{
	public static HashSet primes(int high){
		HashSet primeset=new HashSet();
		for(int i=0;i>high;i++){
			if ((i/2)!=Integer){
				primeset.add(i);
			}
		}
	}
}

-----------------------------------
Clayton
Sat Mar 08, 2008 8:34 pm

RE:booleans
-----------------------------------
Check if the value returned is equal to the value returned casted to an int?

-----------------------------------
A.J
Sat Mar 08, 2008 9:04 pm

Re: booleans
-----------------------------------
to check if x is an integer, round(x) must equal to x.

-----------------------------------
HeavenAgain
Sat Mar 08, 2008 9:24 pm

RE:booleans
-----------------------------------
why not justif (i%2 == 0) // if is 0 then there is no remainder (decimal), or else is 1Integer is a reference type, you cannot compare a int (data type); (i/2), with a reference type; Integer.
