Maybe I'm misunderstanding due to my limited use of biginteger, but I have a program that needs to take user input for page size and virtual address and calculate offset and virtual page. I can do the calculation no problem, but when comparing itegers for the input, the necessary value of virtual address ( 4294967295)is out of range. I tried to declare this number as a big int but the same operators don't seem to work. Do I have to forget the zero and just find a way to say the input is less than or equal to this number? Here is the code:
public class VAddress {
public static void main(String args[]){
BigInteger max = new BigInteger("4294967295");
Scanner PAGEinput = new Scanner(System.in);
Scanner ADDinput = new Scanner(System.in);
System.out.println("Please Enter the system page size (between 512 and 16384):");
int page = PAGEinput.nextInt();
System.out.println("Please Enter the Virtual Address: ");
int address = ADDinput.nextInt();
if(page >= 512 && page <= 16384){
if( address >= 0 && address <= max){
}
}
}
}