# Can I use the Gwnum library to accelerate the multiplication in Mathematica?

Is it possible to use Gwnum library to accelerate the multiplication in Mathematica?

• This appears to be a C library and yes, they can be principally called through LibraryLink. It is not easy though and it also requires a bit of C programming on your sid. – Henrik Schumacher Jul 24 '19 at 17:08
• To be clear, it won't be possible to override the default multiplication operator (but yes you can call any C library through LibraryLink if you take the time to write the glue code). – Szabolcs Jul 24 '19 at 17:46
• Actually, a quick benchmark seems to show that IntegerDigits takes longer than Mathematica's native multiplication ... Do[IntegerDigits[123456789123456789123456789123456789, 65536], {1000}] // RepeatedTiming vs Do[123456789123456789123456789123456789* 123456789123456789123456789123456789, {1000}] // RepeatedTiming – Szabolcs Jul 24 '19 at 20:04
• This reads like 2 questions to me: 1 Q: Is it possible to call the Gwnum library from Mathematica? A: Probably, with a bit of C programming to glue the two together. And, more interesting perhaps 2 Q Will using Gwnum accelerate multiplication ? A: As a paying customer I'd be a bit miffed to find that it did ! – High Performance Mark Jul 27 '19 at 9:45
• While this is an interesting question, I think it would be prudent to add some extra detail in the question body - link to the library, your reasoning that it would be faster, and so on - so as to spend as little of an answerers time as possible. – Carl Lange Jul 27 '19 at 22:21