biginteger calculation problem
Posted
by murali
on Stack Overflow
See other posts from Stack Overflow
or by murali
Published on 2010-05-06T05:48:42Z
Indexed on
2010/05/06
6:28 UTC
Read the original article
Hit count: 195
I am using the following code but the parameters are not passed to the methods.
BigInteger p = BigInteger.valueOf(0);
BigInteger u1 = obj.bigi_calc(g1, l);
In this g1,l are long values.
The method is
private BigInteger bigi_calc(long g1, long l){
BigInteger cal = BigInteger.valueOf(g1);
BigInteger cal1= BigInteger.valueOf(l);
for(BigInteger f = BigInteger.ONE;f.compareTo(cal1)>0;f=f.add(BigInteger.ONE)){
//BigInteger p= BigInteger.valueOf(0);
p = cal.multiply(cal1);
System.out.println("check p"+p);
}
// System.out.println("check p"+p);
return p;
}
The elipse shows that it may be out of sync, but the parameters are not passed to the functions. Can you please help me to solve this problem?
© Stack Overflow or respective owner