Ehm ... I got a problem I've a certain calculation that result is over 10^-308 (the biggest value in double .net ) any way I solved this problem through a library called BIGFLOAT http://www.fractal-landscapes.co.uk/bigint.html ,
What ever I need to calculate something like 0.4 ^(1000 or 100000000) the problem it takes very very long time I didn't study parallel or distributed programming yet but I need a solution that is fast and understandable for me I'm going to deliver this project in next 6 Hours!! :D
Here's the code :
private BigFloat getBlocking(double k)
{
double p1, p2;
BigFloat p3;
p3 = new BigFloat(pp);
p1 = this.P / (double)(k / (double)this.N);
p2 = Math.Pow((1 - p1), 2);
p3= new BigFloat(1-p2,pp);
p3.Pow((int)k);
return p3;
}
where K is 1000 , N is 1001
Download, and reference, the Microsoft J# .NET Library from your C# project - so that you can use J#'s BigDecimal implementation.
See:
Arbitrary-Precision Decimals in C#
and:
Arbitrary precision decimals in C#?
and:
http://geekswithblogs.net/gyoung/archive/2006/05/01/76869.aspx
and:
MSDN - BigInteger, GetFiles, and More
If you don't need all the digits, you can get away with using logarithms. The log of
(0.4 ^ 100000000)
islog(0.4)*100000000
, well within the regular floating point range.