主要言語で任意精度演算

# JavaScript

```fig.html
<!DOCTYPE html>
<html>
<head>
</head>

<body>
<pre id="output"></pre>
<script>

"use strict";

onload = function() {
	let log = "";
	let a = "3";
	let b = "3";
	for (let i = 0; i < 20; i++) {
		const c = BigInt(a) * BigInt(b);
		log += `${i+1}: ${a} * ${b} = ${c}\n`;
		a = "2" + a;
		b = "4" + b;
	}
	output.textContent = log;
};

</script>
</body>
</html>
```

https://jsfiddle.net/orb85g0d/

# Python
Python 3ではintに上限はない模様。

```fig.py
# Python 3
a = "3"
b = "3"
for i in range(20):
	c = int(a) * int(b)
	print(f"{i+1}: {a} * {b} = {c}")
	a = "2" + a
	b = "4" + b
```

https://tio.run/##LY0xDoMwFEPn/FNYvwspC5BOSNyBK/wgoFkCiliqKGcPIerkZ9myz9/1PbzJ@YW5IgwJJrBhsn/djgAH5xHE72szdHoktZTQ@asRjXcFq0md4aGNo2v7NCJKKmG0qXTjkrg06vbAaCGk6sHnMZZyvgE

<details><summary>Decimalの例</summary>

```fig.py
# Python 3
from decimal import Decimal, getcontext
getcontext().prec = 40
a = "3"
b = "3"
for i in range(20):
	c = Decimal(a) * Decimal(b)
	print(f"{i+1}: {a} * {b} = {c}")
	a = "2" + a
	b = "4" + b
```

https://tio.run/##RY1BDsIgEEXXnVNMcAOtMbXtqok7D@AVAGklsUAICw3h7Ehro6v/X/JmvnuHhzV9zge8bRV7mLxd8K6kXvgT9eKsD3j94hFnFaQ1Qb0C/CtlJ@eVxAsOLfASpCcg9pysR43aoOdmVrRr2QjV6u4/KWdY/0AwqJzXJtCJRN2c04iRpyJEkcpNlIkUY9voCDbIodqGhhUE5PwB

</details>

# C++

```fig.cpp
// C++(gcc)
#include <iostream>
#include <boost/format.hpp>
#include <boost/multiprecision/cpp_int.hpp>

using namespace std;
namespace mp = boost::multiprecision;
using Bint = mp::cpp_int;

int main(void)
{
	string a = "3";
	string b = "3";

	for (int i = 0; i < 20; i++) {
		auto c = Bint(a) * Bint(b);
		cout << (boost::format("%1%: %2% * %3% = %4%") % (i+1) % a % b % c)
			<< endl;
		a = "2" + a;
		b = "4" + b;
	}
}
```

https://tio.run/##ZVDLboMwEDzbX7GismTXamlITkB6aD@kMsZJLeGHwORS5dvpmtCXeljtzuzs7No6xoez1stSlvAqJcda0Dvr9TD3BlobpjQa5Z5/cV1AsjyF0an0@B7j/56bh2TjaLSdbPCljvHN@k1L58n6M3jlzBSVNjClvqE/0EU4wmpT1399mm30Bb1Q42Jdb84NpZlzynp@CbYX9IMSPDyrFUqLfdF8E90XQQm@AXietMg9NZhaqHKWUgBaEDWnABqbeSdXAu5vVSfQj@gwJ2hb4Nu5ty/hBduxGljFUM32DKfZgRUCGO6Su5wVRoeBX00IQQfj@yE7rsdWBUhQGa6nHjLsEF7plS7LJw

# C#

```fig.cs
// C#(.NET Core)
using System;
using System.Numerics;

class Program {
	static void Main(string[] args) {
		var a = "3";
		var b = "3";
		for (var i = 0; i < 20; i++) {
			var c = BigInteger.Parse(a) * BigInteger.Parse(b);
			Console.WriteLine($"{i+1}: {a} * {b} = {c}");
			a = "2"+ a;
			b = "4"+ b;
		}
	}
}
```

https://tio.run/##ZY7BSsRADIbPnacI1cPUYlfXPVm9WDwIuiy44EE8pLNjCWw7kMwuyDDPXqddQUQIhO9PvhAjl8axHcfFApozXa0ft9CkoFAHoaGD1y/xtq//ULU@9JbJSK2U2aMIbNh1jD0ElYlHTwaOjnbwgjRo8ZzU9w9A7qSYVrIjMiDcQ36T1z/Y/uKnY9BTRim7qlO7g@XUy/Kkz4JJwwfqngZvO8vVBlmsxgIu/qdtMZ3NGjeI29vqjcnbZxqsPs8DldfxFgLGJIY2pqPBxPwkzC8u8xJwxvnFVcJ2wqhSRTWO3w

# Java

BigInteger：整数
BigDecimal：10進の実数

```fig.java
// Java(OpenJDK 8)
import java.math.BigInteger;

public class Main {
	public static void main(String[] args) {
		String a = "3";
		String b = "3";
		for (int i = 0; i < 20; i++) {
			BigInteger c = new BigInteger(a).multiply(new BigInteger(b));
			System.out.printf("%d: %s * %s = %s\n", i+1, a, b, c);
			a = "2" + a;
			b = "4" + b;
		}
	}
}
```

https://tio.run/##XY5PS8NAEMXP2U/xCBQ2JqZaPYixF/FiRTz0WD1s/jRuTDYhO6kU6WePs6kQEJYZ3m9m9r1KHdRl2xWmyr/GcbnEhoF8Y7B5esFdIHTTtT2hYhw3ij7jR10@GyrKok@E6Ia01hmyWlmLV6UNfoT3By0p4nZodY6GR3JLvTbl7gOqL23gNr0zgsIa/o2fzCSdyb7tIbUhaGZXCbcHrFwPw/Mn3hwJGe@Y4hszkiqIm6Em3dVH@W@UBoFz8LZHS0UTtwPFHdvTXvqL/B4LiwtX1lzejR@x5XUEFSGNkJ0vp@QrHyHUpKfct06nTp8Ev5MYx18

<details><summary>BigDecimalの例</summary>

```fig.java
// Java(OpenJDK 8)
import java.math.BigDecimal;

public class Main {
	public static void main(String[] args) {
		String a = "3";
		String b = "3";
		for (int i = 0; i < 20; i++) {
			BigDecimal c = new BigDecimal(a).multiply(new BigDecimal(b));
			System.out.printf("%d: %s * %s = %s\n", i+1, a, b, c);
			a = "2" + a;
			b = "4" + b;
		}
	}
}
```

https://tio.run/##XY5PS8NAEMXP2U/xCBQSE1OtHsTYi/RUEQ89Wg@TP40bs5uQ3VSK9LPH2UYICMsM7zcz@15NR7puu1LXxdc4LpfYMgjeGGw3L3gIhVRd21vUjBNF9jN5ltWmzKWiJhWiG7JG5sgbMgavJDV@hPcHjSXL7djKAopHwc72UlfvH6C@MqHb9CYEwhr@nZ/OJJvJoe0RSG0hmd2k3J6wcj2Kpk@8ORJy3tHlN2YUUJioobGya07Bv1EWhs7B252MLVXSDjbp2N4eAn9RPGJhcOXKmste@zFb3sagGFmMfLq8JF/5iEAXfcl973Tm9FnwO4tx/AU

</details>