BigInteger's are fun!, not. To set up some initial values for some BigIntegertesting... doesn't work... So what is the "standard" format? (The best conclusion I've come to is that there not exactly standardized, seeing how the length can change..? i don't know) And how do I convert/cast/whatever method I need for this to work:
Check out the methods of the BigInteger class to find out how to convert from an int to a BigInteger and back again (although if the number will fit into an int, I wonder why you would want to use BigInteger). [ December 01, 2003: Message edited by: Marilyn de Queiroz ]
JavaBeginnersFaq "Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Robbie Harjes
Greenhorn
Joined: Nov 09, 2003
Posts: 22
posted
0
Well thanks for the help... But I've come down to just 2 compile time errors. Here's the source code for the program (It's only to find the mod function [remainder] of very large exponential monomials.)
I changed some of the code... realized that the values Y and A are going to be small, but it's only the result of Y^A that requires the BigInteger. Finally, here are the compile-time errors:
[ December 01, 2003: Message edited by: Robbie Harjes ]
Forgive me, but what am i missing??? i don't see a constructor for BigInteger that accepts an int. i think that's what the compiler is complaining about. you can pass it a string... BigInteger big = new BigInteger("7"); that seems to fix one error... the other is that BigInter.mod() takes a BigInteger, not a long... and then... intvalue doesn't take any parameter, you just call it on your BigInteger object you want the value of... integer i = big.intvalue();
Never ascribe to malice that which can be adequately explained by stupidity.