{"id":211,"date":"2009-03-03T07:30:03","date_gmt":"2009-03-03T05:30:03","guid":{"rendered":"http:\/\/mariusbancila.ro\/blog\/?p=211"},"modified":"2009-03-08T19:28:01","modified_gmt":"2009-03-08T17:28:01","slug":"biginteger-is-back","status":"publish","type":"post","link":"https:\/\/mariusbancila.ro\/blog\/2009\/03\/03\/biginteger-is-back\/","title":{"rendered":"BigInteger Is Back"},"content":{"rendered":"<p>One of the new features in .NET 4.0 is the BigInteger class. This was suppose to be part of 3.5 framework, but after the CTP it was gone. Now it&#8217;s back. This big integer is a really large integer representation. However, I was not able to find the precision documented anywhere.<\/p>\n<p>The class is available in the System.Numerics namespace and provides overloaded operators, parsing methods and other utility features for bit integer numbers.<\/p>\n<p>Not very long ago, on <a href=\"http:\/\/www.codexpert.ro\" target=\"_blank\">codexpert.ro<\/a> we launched a contest for finding the biggest pair of <a href=\"http:\/\/en.wikipedia.org\/wiki\/Amicable_number\" target=\"_blank\">amicable numbers<\/a>. One of the members (crystyce) that submited a solution found this big pair (2724918040393706557785752240819405848576, 2724918040396184856306258038787235905536) with a <a href=\"http:\/\/www.codexpert.ro\/forum\/viewtopic.php?f=18&#038;t=958&#038;start=15#p6241\" target=\"_blank\">C++ implementation<\/a> using a 3rd party BigInt class. I decided to put that in C# 4.0 and use BigInteger. Maybe you can find things to optimize in the below code, but that&#8217;s not the point here. I&#8217;m showing you this code just to get a feeling of BitInteger.<\/p>\n<pre class=\"prettyprint\">\r\nusing System.Numerics;\r\n\r\nnamespace cs_test\r\n{\r\n   static class Amicable\r\n   {\r\n      public static BigInteger Pow2(BigInteger exp)\r\n      {\r\n         BigInteger res = 1;\r\n\r\n         for (BigInteger i = 0; i &lt; exp; i++)\r\n            res *= 2;\r\n\r\n         return res;\r\n      }\r\n\r\n      public static BigInteger ExpMod(BigInteger value, BigInteger exp, BigInteger mod)\r\n      {\r\n         BigInteger ullResult = 1;\r\n         BigInteger ullValue = value;\r\n\r\n         while (exp &gt; 0)\r\n         {\r\n            if (exp % 2 != 0)\r\n            { \/\/ odd\r\n               ullResult *= ullValue;\r\n               ullResult %= mod;\r\n            }\r\n\r\n            ullValue *= ullValue;\r\n            ullValue %= mod;\r\n            exp \/= 2;\r\n         }\r\n\r\n         return (ullResult);\r\n      }\r\n\r\n      static public bool IsMillerRabinPrime(BigInteger prime)\r\n      {\r\n         \/\/ randomWitness = witness that the \"prime\" is NOT composite\r\n         \/\/ 1 < randomWitness < prime-1\r\n         long totalWitness = 15;\r\n         BigInteger [] randomWitness = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 51001, 351011};\r\n         BigInteger primeMinusOne = prime - 1;\r\n         BigInteger oddMultiplier;\r\n         long bitLength;\r\n         long i, j;\r\n         BigInteger result;\r\n         \/\/ find oddMultiplier, defined as \"prime - 1 = (2^B) * M\"\r\n         \/\/ get bitLength (B) and find the oddMultiplier (M)\r\n\r\n         \/\/ init value multiplier\r\n         oddMultiplier = primeMinusOne;\r\n\r\n         bitLength = 0; \/\/ reset\r\n         while(oddMultiplier % 2 == 0)\r\n         {\r\n            oddMultiplier \/= 2;\r\n            bitLength++;\r\n         }\r\n         for(i = 0; i < totalWitness; i++)\r\n         {\r\n            if (randomWitness[i] == prime)\r\n               return true;\r\n\r\n            \/\/ init value of result = (randomWitness ^ oddMultiplier) mod prime\r\n            result = ExpMod(randomWitness[i], oddMultiplier, prime);\r\n\r\n            \/\/ is y = 1 ?\r\n            if(result == 1)\r\n               continue; \/\/ maybe prime\r\n\r\n            \/\/ is y = prime-1 ?\r\n            if(result == primeMinusOne)\r\n               continue; \/\/ maybe prime\r\n\r\n            \/\/ loop to get AT LEAST one \"result = primeMinusOne\"\r\n            for(j = 1; j &lt;= bitLength; j++)\r\n            {\r\n               \/\/ square of result\r\n               result = ExpMod(result, 2, prime);\r\n\r\n               \/\/ is result = primeMinusOne ?\r\n               if(result == primeMinusOne)\r\n                  break; \/\/ maybe prime\r\n            }\r\n\r\n            if(result != primeMinusOne)\r\n               return false; \/\/ COMPOSITE\r\n         }\r\n\r\n         \/\/ it may be pseudoprime\/prime\r\n         return true;\r\n      }\r\n\r\n   }\r\n\r\n   class Program\r\n   {\r\n      const int STARTM = 1;\r\n      const int STOPM = 100;\r\n      const int STOPN = 30;\r\n\r\n      static void Main(string[] args)\r\n      {\r\n         DateTime start = DateTime.Now;\r\n\r\n         for (BigInteger m = STARTM ; m &lt;= STOPM ; m++)\r\n         {\r\n            for (BigInteger n = m+1 ; n &lt;= m+STOPN ; n++)\r\n            {\r\n               BigInteger p = Amicable.Pow2(n) + Amicable.Pow2(m) - 1;\r\n               if (!Amicable.IsMillerRabinPrime(p)) continue;\r\n              \r\n               BigInteger q = Amicable.Pow2(2 * n - m) + Amicable.Pow2(n) - 1;\r\n               if (!Amicable.IsMillerRabinPrime(q)) continue;\r\n\r\n               BigInteger r = Amicable.Pow2(3 * n - m) + \r\n                              Amicable.Pow2(n + m) + \r\n                              Amicable.Pow2(2 * n + 1) - 1;\r\n               if (!Amicable.IsMillerRabinPrime(r)) continue;\r\n\r\n               BigInteger f1 = Amicable.Pow2(n) * p * q;\r\n               BigInteger f2 = Amicable.Pow2(n) * r;\r\n\r\n               DateTime end = DateTime.Now;\r\n               Console.WriteLine(\r\n                  \"{2} ... {0}, {1}\", \r\n                  f1, \r\n                  f2, \r\n                  (end - start).Milliseconds \/ 1000.0);\r\n            }\r\n         }\r\n      }\r\n   }\r\n}\r\n<\/pre>\n<pre class=\"prettyprint\">\r\n0.017 ... 220, 284\r\n0.021 ... 2172649216, 2181168896\r\n0.028 ... 17296, 18416\r\n0.040 ... 9363584, 9437056\r\n0.138 ... 2.7249180403937065577857522408E+39, 2.7249180403961848563062580388E+39\r\n<\/pre>\n<p>As you can see, it was very fast finding the same big pair. Well it was at least on my 2 core machine.<\/p>\n<p>The only thing I don't understand about the implementation is the presence of some helper functions in the BigInteger class.<\/p>\n<pre class=\"prettyprint\">\r\npublic static BigInteger Abs(BigInteger value);\r\npublic static BigInteger Add(BigInteger left, BigInteger right);\r\npublic static BigInteger GreatestCommonDivisor(BigInteger left, BigInteger right);\r\npublic static BigInteger Divide(BigInteger dividend, BigInteger divisor);\r\npublic static BigInteger DivRem(BigInteger dividend, BigInteger divisor, out BigInteger remainder);\r\npublic static double Log(BigInteger value);\r\npublic static double Log(BigInteger value, double baseValue);\r\npublic static double Log10(BigInteger value);\r\npublic static BigInteger Max(BigInteger left, BigInteger right);\r\npublic static BigInteger Min(BigInteger left, BigInteger right);\r\npublic static BigInteger ModPow(BigInteger value, BigInteger exponent, BigInteger modulus);\r\npublic static BigInteger Multiply(BigInteger left, BigInteger right);\r\npublic static BigInteger Negate(BigInteger value);\r\npublic static BigInteger Pow(BigInteger value, int exponent);\r\npublic static BigInteger Remainder(BigInteger dividend, BigInteger divisor);\r\npublic static BigInteger Subtract(BigInteger left, BigInteger right);\r\n<\/pre>\n<p>That belongs to <b>System.Math<\/b>, or maybe to a <b>System.Numerics.Math<\/b> class. They are all helper functions, not specific to the implementation of the big integer; and the implementation does not depend on the existing of these functions. So they are clearly utility functions. They should go somewhere else. I have submitted this as feedback to Microsoft Connect. If you agree with it, vote for it <a href=\"https:\/\/connect.microsoft.com\/VisualStudio\/feedback\/ViewFeedback.aspx?FeedbackID=421758\">here<\/a>. Of course, if you have arguments for the current implementation, you can vote against it too.<\/p>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the new features in .NET 4.0 is the BigInteger class. This was suppose to be part of 3.5 framework, but after the CTP it was gone. Now it&#8217;s back. This big integer is a really large integer representation. However, I was not able to find the precision documented anywhere. The class is available &#8230; <a title=\"BigInteger Is Back\" class=\"read-more\" href=\"https:\/\/mariusbancila.ro\/blog\/2009\/03\/03\/biginteger-is-back\/\" aria-label=\"Read more about BigInteger Is Back\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","advgb_blocks_editor_width":"","advgb_blocks_columns_visual_guide":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[11,20],"tags":[451,97,98,89],"class_list":["post-211","post","type-post","status-publish","format-standard","hentry","category-csharp","category-ctps-betas","tag-c","tag-integer","tag-numerics","tag-vs2010"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.1.1 - aioseo.com -->\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Marius Bancila\"\/>\n\t<meta name=\"keywords\" content=\"c++,integer,numerics,vs2010\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/mariusbancila.ro\/blog\/2009\/03\/03\/biginteger-is-back\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.1.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Marius Bancila&#039;s Blog | About code. Mostly on C++\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"BigInteger Is Back\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/mariusbancila.ro\/blog\/2009\/03\/03\/biginteger-is-back\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2009-03-03T05:30:03+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2009-03-08T17:28:01+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"BigInteger Is Back\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2009\\\/03\\\/03\\\/biginteger-is-back\\\/#article\",\"name\":\"BigInteger Is Back\",\"headline\":\"BigInteger Is Back\",\"author\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#organization\"},\"datePublished\":\"2009-03-03T07:30:03+02:00\",\"dateModified\":\"2009-03-08T19:28:01+02:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2009\\\/03\\\/03\\\/biginteger-is-back\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2009\\\/03\\\/03\\\/biginteger-is-back\\\/#webpage\"},\"articleSection\":\"C#, CTPs &amp; Betas, C++, integer, numerics, VS2010\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2009\\\/03\\\/03\\\/biginteger-is-back\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/#listItem\",\"name\":\"IT\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/#listItem\",\"position\":2,\"name\":\"IT\",\"item\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/#listItem\",\"name\":\"Software\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/#listItem\",\"position\":3,\"name\":\"Software\",\"item\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/net\\\/#listItem\",\"name\":\".NET\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/#listItem\",\"name\":\"IT\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/net\\\/#listItem\",\"position\":4,\"name\":\".NET\",\"item\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/net\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/net\\\/csharp\\\/#listItem\",\"name\":\"C#\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/#listItem\",\"name\":\"Software\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/net\\\/csharp\\\/#listItem\",\"position\":5,\"name\":\"C#\",\"item\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/net\\\/csharp\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2009\\\/03\\\/03\\\/biginteger-is-back\\\/#listItem\",\"name\":\"BigInteger Is Back\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/net\\\/#listItem\",\"name\":\".NET\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2009\\\/03\\\/03\\\/biginteger-is-back\\\/#listItem\",\"position\":6,\"name\":\"BigInteger Is Back\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/net\\\/csharp\\\/#listItem\",\"name\":\"C#\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#organization\",\"name\":\"Marius Bancila's Blog\",\"description\":\"About code. Mostly on C++\",\"url\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/#author\",\"url\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/\",\"name\":\"Marius Bancila\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2009\\\/03\\\/03\\\/biginteger-is-back\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a84dd2831d955c38355ddea55df4df260809b88f36408bc14fd4eab8f7f131c9?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Marius Bancila\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2009\\\/03\\\/03\\\/biginteger-is-back\\\/#webpage\",\"url\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2009\\\/03\\\/03\\\/biginteger-is-back\\\/\",\"name\":\"BigInteger Is Back\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2009\\\/03\\\/03\\\/biginteger-is-back\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/#author\"},\"datePublished\":\"2009-03-03T07:30:03+02:00\",\"dateModified\":\"2009-03-08T19:28:01+02:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/\",\"name\":\"Marius Bancila's Blog\",\"description\":\"About code. Mostly on C++\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"BigInteger Is Back","description":"","canonical_url":"https:\/\/mariusbancila.ro\/blog\/2009\/03\/03\/biginteger-is-back\/","robots":"max-image-preview:large","keywords":"c++,integer,numerics,vs2010","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/mariusbancila.ro\/blog\/2009\/03\/03\/biginteger-is-back\/#article","name":"BigInteger Is Back","headline":"BigInteger Is Back","author":{"@id":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/#author"},"publisher":{"@id":"https:\/\/mariusbancila.ro\/blog\/#organization"},"datePublished":"2009-03-03T07:30:03+02:00","dateModified":"2009-03-08T19:28:01+02:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/mariusbancila.ro\/blog\/2009\/03\/03\/biginteger-is-back\/#webpage"},"isPartOf":{"@id":"https:\/\/mariusbancila.ro\/blog\/2009\/03\/03\/biginteger-is-back\/#webpage"},"articleSection":"C#, CTPs &amp; Betas, C++, integer, numerics, VS2010"},{"@type":"BreadcrumbList","@id":"https:\/\/mariusbancila.ro\/blog\/2009\/03\/03\/biginteger-is-back\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog#listItem","position":1,"name":"Home","item":"https:\/\/mariusbancila.ro\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/#listItem","name":"IT"}},{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/#listItem","position":2,"name":"IT","item":"https:\/\/mariusbancila.ro\/blog\/category\/it\/","nextItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/#listItem","name":"Software"},"previousItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/#listItem","position":3,"name":"Software","item":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/","nextItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/net\/#listItem","name":".NET"},"previousItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/#listItem","name":"IT"}},{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/net\/#listItem","position":4,"name":".NET","item":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/net\/","nextItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/net\/csharp\/#listItem","name":"C#"},"previousItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/#listItem","name":"Software"}},{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/net\/csharp\/#listItem","position":5,"name":"C#","item":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/net\/csharp\/","nextItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/2009\/03\/03\/biginteger-is-back\/#listItem","name":"BigInteger Is Back"},"previousItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/net\/#listItem","name":".NET"}},{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/2009\/03\/03\/biginteger-is-back\/#listItem","position":6,"name":"BigInteger Is Back","previousItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/net\/csharp\/#listItem","name":"C#"}}]},{"@type":"Organization","@id":"https:\/\/mariusbancila.ro\/blog\/#organization","name":"Marius Bancila's Blog","description":"About code. Mostly on C++","url":"https:\/\/mariusbancila.ro\/blog\/"},{"@type":"Person","@id":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/#author","url":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/","name":"Marius Bancila","image":{"@type":"ImageObject","@id":"https:\/\/mariusbancila.ro\/blog\/2009\/03\/03\/biginteger-is-back\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/a84dd2831d955c38355ddea55df4df260809b88f36408bc14fd4eab8f7f131c9?s=96&d=mm&r=g","width":96,"height":96,"caption":"Marius Bancila"}},{"@type":"WebPage","@id":"https:\/\/mariusbancila.ro\/blog\/2009\/03\/03\/biginteger-is-back\/#webpage","url":"https:\/\/mariusbancila.ro\/blog\/2009\/03\/03\/biginteger-is-back\/","name":"BigInteger Is Back","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/mariusbancila.ro\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/mariusbancila.ro\/blog\/2009\/03\/03\/biginteger-is-back\/#breadcrumblist"},"author":{"@id":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/#author"},"creator":{"@id":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/#author"},"datePublished":"2009-03-03T07:30:03+02:00","dateModified":"2009-03-08T19:28:01+02:00"},{"@type":"WebSite","@id":"https:\/\/mariusbancila.ro\/blog\/#website","url":"https:\/\/mariusbancila.ro\/blog\/","name":"Marius Bancila's Blog","description":"About code. Mostly on C++","inLanguage":"en-US","publisher":{"@id":"https:\/\/mariusbancila.ro\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Marius Bancila's Blog | About code. Mostly on C++","og:type":"article","og:title":"BigInteger Is Back","og:url":"https:\/\/mariusbancila.ro\/blog\/2009\/03\/03\/biginteger-is-back\/","article:published_time":"2009-03-03T05:30:03+00:00","article:modified_time":"2009-03-08T17:28:01+00:00","twitter:card":"summary","twitter:title":"BigInteger Is Back"},"aioseo_meta_data":{"post_id":"211","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2021-03-18 21:16:02","updated":"2025-12-12 07:25:17","seo_analyzer_scan_date":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"author_meta":{"display_name":"Marius Bancila","author_link":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/"},"featured_img":null,"jetpack_publicize_connections":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"Marius Bancila","author_link":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/"},"uagb_comment_info":0,"uagb_excerpt":"One of the new features in .NET 4.0 is the BigInteger class. This was suppose to be part of 3.5 framework, but after the CTP it was gone. Now it&#8217;s back. This big integer is a really large integer representation. However, I was not able to find the precision documented anywhere. The class is available&hellip;","coauthors":[],"tax_additional":{"categories":{"linked":["<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/net\/csharp\/\" class=\"advgb-post-tax-term\">C#<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/ctps-betas\/\" class=\"advgb-post-tax-term\">CTPs &amp; Betas<\/a>"],"unlinked":["<span class=\"advgb-post-tax-term\">C#<\/span>","<span class=\"advgb-post-tax-term\">CTPs &amp; Betas<\/span>"]},"tags":{"linked":["<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/ctps-betas\/\" class=\"advgb-post-tax-term\">C++<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/ctps-betas\/\" class=\"advgb-post-tax-term\">integer<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/ctps-betas\/\" class=\"advgb-post-tax-term\">numerics<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/ctps-betas\/\" class=\"advgb-post-tax-term\">VS2010<\/a>"],"unlinked":["<span class=\"advgb-post-tax-term\">C++<\/span>","<span class=\"advgb-post-tax-term\">integer<\/span>","<span class=\"advgb-post-tax-term\">numerics<\/span>","<span class=\"advgb-post-tax-term\">VS2010<\/span>"]}},"comment_count":"0","relative_dates":{"created":"Posted 18 years ago","modified":"Updated 18 years ago"},"absolute_dates":{"created":"Posted on March 3, 2009","modified":"Updated on March 8, 2009"},"absolute_dates_time":{"created":"Posted on March 3, 2009 7:30 am","modified":"Updated on March 8, 2009 7:28 pm"},"featured_img_caption":"","series_order":"","jetpack_shortlink":"https:\/\/wp.me\/pYNdv-3p","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/posts\/211","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/comments?post=211"}],"version-history":[{"count":6,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/posts\/211\/revisions"}],"predecessor-version":[{"id":216,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/posts\/211\/revisions\/216"}],"wp:attachment":[{"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/media?parent=211"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/categories?post=211"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/tags?post=211"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}