代码:
package cn.tedu.math;
import java.math.BigInteger;
public class BigIntegerDemo {
public static void main(String[] args) {
//计算超大数
BigInteger bi1=new BigInteger(“12613671267137126317263173617263712637126371263712637126376127361723671263712371236812638172387123681723781638112736172361273612736172361827361”);
BigInteger bi2=new BigInteger(“27346182738123712873812973198273812739871289739182738123817823187381273812738137813781237812738173719283718273817238172837128371283718273198371827318923718927389127398127938172739813”);
//计算超大数的乘积
System.out.println(bi1.multiply(bi2));
}
}
输出:
344935759469752343897857370829205459792633112522558698742786148581041681063809557557607137032267354056231738919506997401308323798128287418911371096199929183784477599702780496401462486645446130856028519843295679913553386026367620294747264926432282795873340650179629733303491259630388865539386029287455236644979029444677423493
代码图:
输出: