Link to home
Start Free TrialLog in
Avatar of DancingFighterG
DancingFighterG

asked on

Question on value of digits

I'm going to build a mini calculator that does multiplication, subtration and addition. Now, when I ask the user for a value of course the number can be very small or very large in size. Now my questions is that when I do an operation on these vales to get a new value with Java be able to hanldle a number that is very large in size or do I have to do some bit manipulation to handle and calculate the number. For example if the user puts in 1000000 * 45645554 and I get an answer with a operation function that I make will that be hard for Java to compute and if so what is the best way to go about coming up with a solution for this. Example of this would be great for me.
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

I would check by creating a BigInteger from an entered String and then ascertain if > Long.MAX_VALUE. If so, you can't handle the calc with primitives
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DancingFighterG
DancingFighterG

ASKER

Thanks man!
:-)