Tuesday 2 February 2016

BigInteger C#


 BigInteger

No more depending on inbuilt data types or custom types for creating more of a tightly coupled to a requirement, resulting in loose coupling.


In BigInteger data type, there is no upper or lower limit. It is user defined structure. The data holding capacity is as much as the space in Stack. BigInteger is structure hence it is  a value type. The constructor would define take the upper limit as argument. It supports all the numeric data types including double, decimal and byte arrays.


So, instead of ,
           int a = 0;

// error 
a = Int32.MaxValue + 200;

we can use
BigInteger myInt = new BigInteger(Int32.Max+200);

Thanks and keep hardworking!!


Ashumeet Mitter
  

No comments:

Post a Comment