Question

I have to multiply two big numbers - saved as string - any hint how to do that?

Was it helpful?

Solution

Think back to grade school, and how you would solve the problem long-hand.

OTHER TIPS

Depends on the language and how large the numbers are. For example in C, you can convert string to int with atoi and then multiply if the product will fit in 32bit int. If number is too large for 32bit you'll probably have to use third-party BigInt library. Some languages (python, haskell) have built-in support for bigint, so you can multiply numbers of any size.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top