I have a python program which should multiply 2 big integers.
The problem is I get a different result in java with BigInteger
class with same input.
I have tried DecInt library for python but gives the same answer as using pure python.
Here are my variables:
d = 372049305848826709205673800090501485720867768816
r = 5452188953055713107393819158892374332916586527736541041226026450382
Result I get in python from d * r
:
2028483115341019294875069650745272851135156323450218238187883716036516369477015140871224045070868977706272670887712
Result I get in java with BigInteger
class:
9530687378863294988874153740700860249994095546182028483115341019294875069650745272851135156323450218238187883716036516369477015140871224045070868977706272670887712
Here is my java code:
BigInteger d = new BigInteger("372049305848826709205673800090501485720867768816");
BigInteger r = new BigInteger("5452188953055713107393819158892374332916586527736541041226026450382");
BigInteger tmp1 = d.multiply(r);
System.out.println(tmp1);
As you can see, there are some most significant digits that are missed in python's result.
Is there any solution for that?