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
pp
is, I'm not sure there's much we can do to help. – Warmongering0.4 ^ 1E+8
, which is a number with 40 million zeros between the decimal point and the first non-zero digit! Clearlydecimal
is not suitable to his needs. – Warmongeringnew BigFloat(0.4, new PrecisionSpec(1000, PrecisionSpec.BaseType.DEC)).Pow(100000000);
takes about 11ms on my machine. That seems pretty fast to me. – Warmongering