How to find double output?

1 view (last 30 days)
Ammy
Ammy on 2 Mar 2022
Commented: Ammy on 2 Mar 2022
import java.math.*;
>> p=BigInteger('11');
>> m=BigInteger('2');
>> [A,B]=m.gcd(p);
Error using java.math.BigInteger/gcd
Java methods cannot be called with multiple output arguments
How to resolve this issue? I need both A and B.
Thanking in anticipation
  7 Comments
Ammy
Ammy on 2 Mar 2022
@AndresVar, thank you very much but I want to deal with both the outputs.

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 2 Mar 2022
import java.math.*;
p = BigInteger('11');
m = BigInteger('2');
A = m.gcd(p)
A = 1
B = m.modInverse(p)
B = 6
m.multiply(B).mod(p)
ans = 1
  3 Comments
Ammy
Ammy on 2 Mar 2022
Thank you very much!

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!