I'm trying to implement some functionality that was formerly provided via an Excel sheet into a C# application, but the probability mass function of Accord.NET differs for some reason from the excel function.

In excel the probabilty mass function, is used this way

```
=BINOM.DIST(250; 3779; 0.0638; FALSE)
Result: 0.021944019794458
```

When I try it with Accord.NET

```
var binom = new BinomialDistribution(3779, 0.0638);
binom.ProbabilityMassFunction(250);
// Result: Infinity
```

But the cumulative distribution seems to work properly (except for the last few digits, but I assumed this is just some kind of precision error)

Excel:

```
=BINOM.DIST(250; 3779; 0.0638; TRUE)
Result: 0.736156366002849
```

Accord.NET:

```
var binom = new BinomialDistribution(3779, 0.0638);
binom.DistributionFunction(250);
// Result: 0.736156366002318
```

Why are the results so different? And is there a way to get the Excel result with Accord?

**EDIT:** Extreme.Numerics calculates the same result as Excel, but I don't want to use this library, as the license system of this library always led to trouble in the past.

**EDIT 2:** Seems like some kind of overflow error.

When I use this I get the right result:

```
Math.Exp(binom.LogProbabilityMassFunction(250));
```

Any ideas why this could be happening?