ã¯ããã«
ã³ã³ãã¥ãŒã¿ã¯ããããæ°ãå¶éãããŠããæ°å€ã§åäœã§ããããšãç¥ãããŠããŸãã ååãšããŠã32ãããæŽæ°ãš64ãããæŽæ°ã®åŠçã«æ £ããŠããŸãããããã¯ã.NETãã©ãããã©ãŒã ã§ã¯ãããããInt32ïŒintïŒåãšInt64ïŒlongïŒåã«å¯Ÿå¿ããŠããŸãã
ãŸãã29ãªã©ã®æ°åãæ³åããå¿ èŠãããå Žåã¯ã©ãããã°ããã§ããããã = 884176199373970195454361616000000ïŒ ãã®ãããªæ°å€ã¯ã64ãããã®ããŒã¿åã§ã¯ãªãã32ãããã®ããŒã¿åã«ã¯åãŸããŸããã é·ãç®è¡æŒç®ãååšãããããªå€§ããªæ°ãæ±ãããã§ãã
é·ãç®è¡ -ã³ã³ãã¥ãŒã¿ãŒæè¡ã§ã¯ãããã深床ãç¹å®ã®ã³ã³ãã¥ãŒã¿ãŒã®æ©æ¢°èªé·ãè¶ ããæ°ã«å¯ŸããæŒç®ïŒå ç®ãä¹ç®ãæžç®ãé€ç®ã环ä¹ãªã©ïŒã ãããã®æäœã¯ããŒããŠã§ã¢ã§ã¯ãªãããœãããŠã§ã¢ã§å®è£ ãããåºæ¬çãªããŒããŠã§ã¢ã䜿çšããŠå€æ°ã®äœæ¬¡æ°ã§åäœããŸãã
ãã³ã°ç®è¡ã¯ããªãªã³ããã¯ããã°ã©ãã³ã°ã®ã»ã¯ã·ã§ã³ã®1ã€ãšèããããšãã§ããŸããããã¯ãåé¡ã解決ããéã«ãæšæºã¿ã€ãã§ã¯æçµçµæãè¡šãã®ã«ååã§ãªãããšãéåžžã«å€ãããã§ãã olympiadã®ããŒãºã«åã£ãããã°ã©ãã³ã°èšèªãéžæããå Žåãçµã¿èŸŒã¿ã®ããŒã«ã»ããïŒæ¢è£œã®ã©ã€ãã©ãªãå®è£ ãããã¯ã©ã¹ïŒã¯éèŠã§ã¯ãããŸããã å€ãã®èšèªïŒJavaãRubyãPythonïŒã«ã¯é·ãç®è¡æŒç®ãçµã¿èŸŒãŸããŠãããããããã°ã©ã ã®äœæã«ãããæéãå€§å¹ ã«ççž®ã§ããŸãã
ããŒãžã§ã³4.0ãŸã§ã®.NETãã©ãããã©ãŒã ã«ã¯ãé·ãæ°åãæ±ãããã®çµã¿èŸŒã¿ã®ãµããŒãããããŸããã§ããã 4çªç®ã®ããŒãžã§ã³ã§ã¯ã.NETã¯é·ãã ãã§ãªããè€çŽ æ°ãååŸããŸããã ãã®æ©èœã¯System.Numericsã¢ã»ã³ããªãä»ããŠå©çšã§ãã BigIntegerããã³Complexåã¯ãã¢ã»ã³ããªãšåãååã®åå空éã§å®çŸ©ãããŸãã
BigIntegeræ§é ã¯.NET 3.5ã«è¡šç€ºãããã¯ãã§ãããããã®æç¹ã§ã¯å®å šã«æºåãæŽã£ãŠããªãã£ãããããã®å®è£ ã¯ãã¹ãŠã®ããŒãºãæºãããŠããªãã£ãïŒããã©ãŒãã³ã¹ã®åé¡ãåå ãšèããããïŒãããçµäºã.NETã«å»¶æããããšã«ããŸãã4.0ã
ãã®èšäºã§ã¯ãMicrosoftã®longç®è¡ã®å®è£ ã®è©³çŽ°ãæ€èšããŸãã
äžè¬çãªæŠå¿µ
ã³ã³ãã¥ãŒã¿ã®ã¡ã¢ãªã§é·ãæ°åãè¡šããšããèãæ¹ã¯éåžžã«ç°¡åã§ãã 10é²æ°ã·ã¹ãã ã®123456789ãæ€èšããŠãã ããã æããã«ã次ã®ããã«è¡šãããšãã§ããŸãã
123456789 10 = 1 * 10 8 + 2 * 10 7 + 3 * 10 6 + 4 * 10 5 + 5 * 10 4 + 6 * 10 3 + 7 * 10 2 + 8 * 10 1 + 9 * 10 0
äžè¬ã«ãä»»æã®æ°ã¯æ¬¡ã®ããã«è¡šãããšãã§ããŸãã
A = a n- 1βn -1 + a n- 2βn -2 + ... + a 1β+ a 0
ããã§ãβã¯æ°ãè¡šãæ°äœç³»ã®åºæ°ã§ãããä¿æ°a iã¯äºéäžçåŒ0â€a i <βãæºãããŸãã
æ°å€ã®è¡šçŸã¯ãå€é åŒã®è¡šçŸãé£æ³ãããŸããé©åãªçšåºŠã®xã®ä»£ããã«ãå¿ èŠãªçšåºŠã®åºÎ²ããããŸãã æ¢ç¥ã®ããã«ãå€é åŒa 0 + a 1 x + a 2 x 2 + ... + a n x nã¯ãèŠçŽ ãä¿æ°a iãè¡šãé åã®åœ¢åŒã§è¡šãã®ã䟿å©ã§ãã€ã³ããã¯ã¹iã¯å¯Ÿå¿ãã次æ°xã決å®ããŸãã é·ãæ°å€ãåæ§ã«ä¿åãããããŒã¹Î²ã®éžæã決å®ããŸãã
ããšãã°ãåãçªå·123456789ã¯ã次ã®ããã«1äžïŒÎ²= 10 4 ïŒã®æ°å€ã·ã¹ãã ã§è¡šãããšãã§ããŸãã
123456789 10 = 1 *ïŒ10 4 ïŒ 2 + 2345 *ïŒ10 4 ïŒ 1 + 6789 *ïŒ10 4 ïŒ 0
10,000æ¡ã®æ°å€ã·ã¹ãã ã§123456789ãšããæ°å€ãè¡šããšã2ã€ã®å©ç¹ãåæã«åŸãããŸãã1ã€ã¯ã9ã€ã®æ°å€ã®é åã§ã¯ãªã3ã€ã®æ°å€ã®é åïŒ1ã2345ããã³6789ïŒäžåºŠã«4æ¡ã®æ°åãåŠçãããããé·ãæ°åã®æšæºæäœã®å®è¡æéãççž®ããŸãã äžè¬ã«ãã³ã³ãã¥ãŒã¿ãŒã¯1ããããš32ãããã®æ°å€ãåãããã«ãã°ããå ç®ãããããããã䜿çšããå¿ èŠããããŸãã
éåžžãæ°å€ã·ã¹ãã βã®ããŒã¹ã¯ãã³ã³ãã¥ãŒã¿ãŒäžã®ããŒã¹ããŒã¿åã®æ倧ãµã€ãºã«äŸåãã次ã®èæ ®äºé ã«åºã¥ããŠéžæãããŸãã
- ããŒã¹ã¯ãåºæ¬ããŒã¿åã®ããããã«é©åããªããã°ãªããŸããã
- åºæ°ã¯ãé·ãæ°ã®è¡šçŸã®ãµã€ãºãå°ããããŠæäœã®é床ãäžããããã«ã§ããã ã倧ããããå¿
èŠããããŸãããä¿æ°ãæã€ãã¹ãŠã®æäœãåºæ¬ããŒã¿åã䜿çšããããã«ååã«å°ããããå¿
èŠããããŸã
- åºåãšãããã°ã®å©äŸ¿æ§ã®ããã«ã10ã®çŽ¯ä¹ãšããŠÎ²ãéžæã§ããŸããβ-2ã®çŽ¯ä¹ã䜿çšãããšãäœã¬ãã«ã§é«éæäœãå®è¡ã§ããŸãã
ãŸããæ°å€ã®ç¬Šå·ã¯å¥ã®å€æ°ã§èæ ®ãããããšã«æ³šæããŠãã ãããã€ãŸããé åã«ã¯é·ãæ°å€ã®ã¢ãžã¥ãŒã«ãå«ãŸããæ°å€ãéæ¹åã«æ ŒçŽãããŸãã ããã¯äž»ã«äŸ¿å®äžè¡ãããŸãããæ°å€ã®ç¬Šå·ãæ ŒçŽã§ããé åã®ãŒã/æåŸã®èŠçŽ ãç¹å¥ã«åŠçããå¿ èŠã¯ãªãããã¹ãŠã®æäœã¯æäžäœããæäžäœãŸã§å®è¡ãããŸãã
Microsoftã®BigInteger
ReflectorãŸãã¯dotPeekãã³ã³ãã€ã©ãŒãä»ããŠBigIntegeræ§é ãèŠããšã次ã®ãã£ãŒã«ãã衚瀺ãããŸãã
private static readonly BigInteger s_bnMinInt = new BigInteger(-1, new uint[1]{ (uint) int.MinValue }); private static readonly BigInteger s_bnOneInt = new BigInteger(1); private static readonly BigInteger s_bnZeroInt = new BigInteger(0); private static readonly BigInteger s_bnMinusOneInt = new BigInteger(-1); internal int _sign; internal uint[] _bits; private const int knMaskHighBit = -2147483648; private const uint kuMaskHighBit = 2147483648U; private const int kcbitUint = 32; private const int kcbitUlong = 64; private const int DecimalScaleFactorMask = 16711680; private const int DecimalSignMask = -2147483648;
æ§é äœã«ã¯2ã€ã®ã€ã³ã¹ã¿ã³ã¹ãã£ãŒã«ãïŒ_signããã³_bitsïŒã®ã¿ãå«ãŸããæ®ãã®ãã£ãŒã«ãã¯å®æ°ãããã³æ°å€-1ã0ã1ã®æ§é äœå€ãè¡šãéçèªã¿åããã£ãŒã«ãã§ãã
æ°å€ã®ç¬Šå·ã¯å€æ°_signã«æ ŒçŽããã_bitsé åã«ã¯ä¿æ°a iãå«ãŸãããšä»®å®ã§ããŸãã _bitsé åã®ã¿ã€ããuint []ã§ããå Žåãβã®åºã2 2 32ã®ã¹ãä¹ã§ãããšä»®å®ããããšãã§ããŸãïŒuintã¯32ããã笊å·ãªãæ°å€ã§ããããïŒã
ãããã£ãŠãæã ã¯ä»®å®ã確èªãŸãã¯åè«ããããšããŸãã
intããšãã³ã³ã¹ãã©ã¯ã¿ãŒã¯ãåŒæ°ãšããŠæ¬¡ã®ããã«ãªããŸãã
intãåãå
¥ããã³ã³ã¹ãã©ã¯ã¿ãŒ
public BigInteger(int value) { if (value == int.MinValue) { this = BigInteger.s_bnMinInt; } else { this._sign = value; this._bits = (uint[]) null; } }
ãã®å®è£ ã«ããã_signå€æ°ã®ç®çã«ã€ããŠããå°ãç¥ãããšãã§ããŸãã ã芧ã®ãšãããé·ãæ°å€ãintã®ç¯å²ïŒ-2 31ã2 31 -1ïŒã«é 眮ããããšã_signå€æ°ã«æ ŒçŽããã_bitsé åã¯äœ¿çšããããnullã«ãªããŸãã ãã®æé©åã«ããã BigIntegeråã®äœæ¥ãé«éåãããã ãã§ãªããå®éã«æ°å€ã倧ãããªãå Žåã«æ¶è²»ãããã¡ã¢ãªã®ãµã€ãºãåæžãããŸãã
ã©ãã
uintãåŒæ°ãšããŠåãã³ã³ã¹ãã©ã¯ã¿ã¯æ¬¡ã®ããã«ãªããŸãã
ã³ã³ã¹ãã©ã¯ã¿ãŒãã¹ãuint
public BigInteger(uint value) { if (value <= (uint) int.MaxValue) { this._sign = (int) value; this._bits = (uint[]) null; } else { this._sign = 1; this._bits = new uint[1]; this._bits[0] = value; } }
æ°å€ãintç¯å²ã«é 眮ããããã©ããã«å¿ããŠã_signå€æ°ãŸãã¯_bitsé åã®ããããã«æžã蟌ãŸããŸãã
次ã®ã³ã³ã¹ãã©ã¯ã¿ã¯ã64ãããã®ç¬Šå·ä»ãæ°å€ïŒé·ãïŒãåãå ¥ããæ°å€ã·ã¹ãã ã®åºæ°ã®éžæã«é¢ãã質åã«çããã®ã«åœ¹ç«ã¡ãŸãã
ã³ã³ã¹ãã©ã¯ã¿ãŒãã¹ããã³ã°
public BigInteger(long value) { if ((long) int.MinValue <= value && value <= (long) int.MaxValue) { if (value == (long) int.MinValue) { this = BigInteger.s_bnMinInt; } else { this._sign = (int) value; this._bits = (uint[]) null; } } else { ulong num; if (value < 0L) { num = (ulong) -value; this._sign = -1; } else { num = (ulong) value; this._sign = 1; } this._bits = new uint[2]; this._bits[0] = (uint) num; this._bits[1] = (uint) (num >> 32); } }
æ°å€ãintã®ç¯å²ã«åãŸããªãå Žåãã芧ã®ãšããã_signå€æ°ã«ã¯æ°å€ã®ç¬Šå·ïŒè² ã®å Žåã¯-1ãæ£ã®å Žåã¯1ïŒãå«ãŸãã_bitsé åã«ã¯åãä¿æ°a iãå«ãŸãã次ã®ããã«å ¥åãããŸãã
this._bits = new uint[2]; this._bits[0] = (uint) num; this._bits[1] = (uint) (num >> 32);
ãã®å Žåã64ãããã®æ°å€numã¯ãïŒuintïŒnumãšïŒuintïŒïŒnum >> 32ïŒã®2ã€ã®32ãããæ°å€ã«åå²ãããŸãã æåã®æ°å€ã¯numã®æåŸã®32ãããã§ã2çªç®ã®æ°å€ã¯æåã®32ãããã§ãïŒnãããã ãå³ã«ã·ããããããšã¯ãæŽæ°ã2 nã§é€ç®ããããšãšåçã§ãïŒã
æ°å€long.MaxValue = 2 63 -1 = 9223372036854775807ãBigIntegeræ§é ã«æ ŒçŽãããæ¹æ³ã決å®ããŸãããã ãããè¡ãã«ã¯ã2 32ã§é€ç®ããŸãã
å®éã«ã¯ïŒuintïŒlong.MaxValue = 4294967295ãïŒuintïŒïŒlong.MaxValue >> 32ïŒ= 2147483647ã
ãããã£ãŠã9223372036854775807 = 2147483647 *ïŒ2 32 ïŒ 1 + 4294967295 *ïŒ2 32 ïŒ 0 ãããã³BigInteger
ãã¢ã§è¡šãããŸãïŒ
_sign = 1
_bits = {4294967295ã2147483647} //æ°å€ã¯éæ¹åã«ä¿åãããããšãèŠããŠãããŠãã ãã
é·ãçªå·-1234567891011121314151617181920ã®å ŽåïŒ
ã€ãŸããæ°ã¯æ¬¡ã®ããã«2 32ã®çŽ¯ä¹ã§æ¡åŒµãããŸãã
1234567891011121314151617181920 = 15 *ïŒ2 32 ïŒ 3 + 2501550035 *ïŒ2 32 ïŒ 2 + 3243814879 *ïŒ2 32 ïŒ 1 + 4035623136 *ïŒ2 32 ïŒ 0
ãããã£ãŠã BigIntegerã¯ãã¢ã§è¡šãããŸãã
_sign = -1 //æ°å€ã®ç¬Šå·
_bits = {4035623136ã3243814879ã2501550035ã15}
ããšãã°17ã®intç¯å²ã«åãŸãæ°å€ã¯ã次ã®ããã«æ ŒçŽãããŸãã
_sign = 17
_bits = null
BigIntegeræ§é äœã®ã³ã³ã¹ãã©ã¯ã¿ãŒã調ã¹ãã ã次ã®ããã«çµè«ä»ããããšãã§ããŸãã
- æ°å€ãintç¯å²ã«ããå Žåãå€æ°_signã«æ ŒçŽãããŸãã
- æ°å€ãintç¯å²ã«åãŸããªãå Žåããã®ç¬Šå·ã¯å€æ°_signïŒè² ã®å Žåã¯-1ãæ£ã®å Žåã¯1ïŒã«æ ŒçŽããã_bitsé åã«ã¯2 32ãåºãšããé·æŽæ°ã®å±éã®ä¿æ°a iãå«ãŸããŸãã
äžè¬ã«ã BigIntegeræ§é ã¯ã.NETãã©ãããã©ãŒã ã§ã®é·ãæŒç®ã®æ¬æ Œçãªå®è£ ã§ãã åæã«ãMicrosoftã¯ããªããã£ããªæ°å€åã«ã§ããã ãè¿ã¥ããããšããŸãããBigIntegerã€ã³ã¹ã¿ã³ã¹ã¯ãä»ã®æŽæ°åãšåãããã«äœ¿çšã§ããŸãã BigIntegerã¯æšæºã®æ°å€æŒç®åããªãŒããŒããŒãããŠãå ç®ãæžç®ãé€ç®ãä¹ç®ãæžç®ãåŠå®ãåé åŠå®ãªã©ã®åºæ¬çãªæ°åŠæŒç®ãå®è¡ããŸãã æšæºã®æ°å€æŒç®åã䜿çšããŠã2ã€ã®BigIntegerå€ãäºãã«æ¯èŒããããšãã§ããŸãã ä»ã®ã¿ã€ãã®æŽæ°ãšåæ§ã«ã BigIntegerã¯ãããæŒç®åAndãOrãXORãå·Šã·ãããå³ã·ããããµããŒãããŠããŸãã
ãŠãŒã¶ãŒå®çŸ©æŒç®åããµããŒãããªãèšèªã®å Žåã BigIntegeræ§é äœã¯ãæ°åŠæŒç®ãå®è¡ããããã®åçã®ã¡ãœãããæäŸããŸãã ããã¯ãå ç®ãé€ç®ãä¹ç®ãåŠå®ãæžç®ãªã©ã®ã¡ãœããã«é©çšãããŸãã Microsoftã¯ã Decimalãã¬ãŒã ã¯ãŒã¯ã®å®è£ ã§ããŸã£ããåãããšãè¡ããŸããã
BigIntegeræ§é äœã®å€ãã®ã¡ã³ããŒã¯ãä»ã®æŽæ°åã®ã¡ã³ããŒã«çŽæ¥å¯Ÿå¿ããŠããŸãã ããã«ã BigIntegerã¯æ¬¡ã®ãããªèŠçŽ ãè¿œå ããŸãã
- IsEven-æ°å€ãå¶æ°ãã©ãããå€æããŸãã
- IsPowerOfTwo-æ°å€ã2ã®ã¹ãä¹ãã©ãããå€æããŸãã
- 笊å·-BigIntegeræ°ã®ç¬Šå·ã瀺ãå€ãè¿ããŸãã
- Abs-BigIntegeræ°ã®çµ¶å¯Ÿå€ãè¿ããŸãã
- DivRem-åãšé€ç®ã®å°äœãè¿ããŸãã
- GreatestCommonDivisor-2ã€ã®æ°å€ã®æå€§å ¬çŽæ°ãè¿ããŸãã
- Log-æå®ãããåºæ°ãæã€æ°å€ã·ã¹ãã ã®æå®ãããæ°å€ã®å¯Ÿæ°ãè¿ããŸãã
- æ倧/æå°-2ã€ã®æ°å€ã®æ倧/æå°ãè¿ããŸãã
- ModPow-æ°å€ãå¥ã®æ°å€ã®çŽ¯ä¹ã§ã¢ãžã¥ã©ãŒé€ç®ããŸãã
- Pow-BigIntegerã®å€ãæå®ãããçšåºŠãŸã§äžããŸãã
Monoããã³Javaã§ã®BigIntegerã«é¢ããããã€ãã®èšè
Monoã¯ãé·ãæŒç®ããµããŒãããŠããããšã«æ³šæããŠãã ããã Monoã§ã®BigIntegeræ§é ã®å®è£ ã¯ãintã§è¡šãããæ°å€ã®æé©åããªãããšãé€ããŠãMicrosoftã®å®è£ ãšå®è³ªçã«å€ãããŸããã
ã€ãŸããMonoã®çªå·17ã¯ãã¢ã§è¡šãããŸãã
_sign = 1 //æ°å€ã®ç¬Šå·
_bits = {17}
BigIntegerã®åæ§ã®å®è£ ãJavaã§æäŸãããŠããŸãã
public class BigInteger extends Number implements Comparable<BigInteger> { int signum; int[] mag; private int bitCount = -1; private int bitLength = -1; private int lowestSetBit = -2; private int firstNonzeroByteNum = -2; private int firstNonzeroIntNum = -2; private final static long LONG_MASK = 0xffffffffL; }
Javaã«ã¯ç¬Šå·ãªãã®åããªããããmagé åã¯int []åã§ãã ãããã£ãŠãJavaãš.NETã§ã®é·ãæ°å€ã®è¡šçŸã¯ç°ãªããŸãã .NETã§ã¯ãuintåã®ç¯å²ãåºãããããã¬ãŒã³ããŒã·ã§ã³ã®å¹çãå°ãåäžããŸãã
ã³ã³ã¹ãã©ã¯ã¿ãŒãã¹ããã³ã°
private BigInteger(long val) { if (val < 0) { signum = -1; val = -val; } else { signum = 1; } int highWord = (int)(val >>> 32); if (highWord == 0) { mag = new int[1]; mag[0] = (int)val; } else { mag = new int[2]; mag[0] = highWord; mag[1] = (int)val; } }
JavaãšMonoã§ã¯ãintã§è¡šãããæ°å€ã®æé©åã¯ãããŸããã
BigIntegerã®ããã©ãŒãã³ã¹
é·ãBigIntegerçªå·ã䜿çšããå Žåãæœåšçãªããã©ãŒãã³ã¹ã®åé¡ã«æ³šæããå¿ èŠããããŸãã ããšãã°ãäžèŠç¡å®³ãªæŒç®å++ã¯ãããã©ãŒãã³ã¹ã«å€§ããªåœ±é¿ãäžããå¯èœæ§ããããŸãã
int length = 1000000; BigInteger num = BigInteger.Parse("12345678910111213141516171819"); for (int i = 2; i < length; i++) { if (IsPrime(i)) num++; } Console.WriteLine(num);
ãã®äŸã§ã¯ãæ¢åã®ãªããžã§ã¯ãã®å€ãå€ããããã§ãããããã§ã¯ãããŸããã BigIntegerãªããžã§ã¯ãã¯äžå€ã§ããã€ãŸããå éšã§ã¯ãå ±éèšèªã©ã³ã¿ã€ã ãå®éã«æ°ããBigIntegerãªããžã§ã¯ããäœæãã以åã®ãªããžã§ã¯ãããã1ã€å€§ããå€ãå²ãåœãŠãŸãã
ãã®äŸã§ã¯ã次ã®ããšãã§ããŸããéåžžã®æ°å€åã䜿çšããŠäžéæäœãå®è¡ãã BigIntegerã䜿çšããŸãã
int length = 1000000; BigInteger num = BigInteger.Parse("12345678910111213141516171819"); int temp = 0; for (int i = 2; i < length; i++) { if (IsPrime(i)) temp++; } num += temp; Console.WriteLine(num);
ä»ã®.NET Frameworkæ°å€åãäžå€ã§ãã ãã ãã BigIntegeråã«ã¯äžéãŸãã¯äžéããªãããããã®å€ã¯éåžžã«å€§ããªå€ã«æé·ããããã©ãŒãã³ã¹ã«æž¬å®å¯èœãªåœ±é¿ãäžããå¯èœæ§ããããŸãã
çµè«ã®ä»£ããã«
èŠçŽãããšãããŒãžã§ã³4以éã®.NETãã©ãããã©ãŒã ã¯ã æŽæ°ã®é·æŒç®ã®æ¬æ Œçãªå®è£ ãç²åŸãããšèšããŸãã ãããããå®å šãªå¹žçŠã®ããã«ãé·ãé.NET BCLã®ããŒã¿ã¹ããŒã¿ã¹ã«ååšããŠããBigRationalæ§é ãå®è£ ããããšãæ®ã£ãŠããŸãã
BigRationalæ§é ã®èª¬æïŒ BigRationalæ§é 㯠ã.NET Framework 4ã§å°å ¥ãããBigIntegeråã«åºã¥ããŠãããä»»æã®ç²ŸåºŠã®æçæ°ãäœæã§ããŸãã æçæ°ã¯2ã€ã®æŽæ°ã®æ¯çã§ããã BigRationalæ§é ã®ãã®å®è£ ã§ã¯ã BigIntegeråã被é€æ°ïŒååïŒããã³é€æ°ïŒåæ¯ïŒãšããŠäœ¿çšãããŸãã
ã³ã¡ã³ããããããšãïŒ gouranga