DCSIMG
BigInteger - Pavel's Blog
Sign in | Join | Help

Pavel's Blog

Pavel is a software guy that is interested in almost everything
software related... way too much for too little time

Browse by Tags

Calculating PI in .NET
30 December 11 10:31 PM | pavely | 2 comment(s)
I always loved mathematics. Although I’m certainly not a mathematician by profession, I’m always intrigued and inspired by math’s pureness and cleverness. One of the simplest and fascinating aspects of math is the number PI . Described simply as the ratio of a circle’s circumference to its diameter, it’s a constant with infinite digits after the decimal point and most importantly, non repeating (at least as far as I know). There are many ways to calculate PI, as evident within the PI Wikipedia link...
BigInteger in .NET 4.0
26 May 09 02:26 PM | pavely | 1 comment(s)
One of the simplest new additions to the .NET 4.0 framework is an integer with arbitrary length, System.Numerics.BigInteger . Here’s a simple usage example, comparing it to a double:   BigInteger b = BigInteger . Pow (2, 64); Console . WriteLine ( "BigInteger: {0}" , b . ToString ( "N" )); Console . WriteLine ( "Double:     {0}" , Math . Pow (2, 64). ToString ( "N" )); Console . WriteLine (); b = BigInteger . Pow (2, 128); Console ...