Question: is there `MulDiv`

```
WINBASEAPI
int
WINAPI
MulDiv(
    _In_ int nNumber,
    _In_ int nNumerator,
    _In_ int nDenominator
    );

```

in C# or an equivalent to it?

or should I Implement it ?

Edit: with out PInvoking!!

Answer: 
No, this is not available out-of-the-box. You need to do [PInvoke](http://pinvoke.net).

You can implement it yourself of course:

```
//truncation is unnecessary if you want to continue using a long
//the truncation can never overflow so it is unchecked
var result = unchecked((int)(nNumber * (long)nNumerator / nDenominator));

```
If you want to make it clear that you're going out of your way to handle the case where two 32-bit integers may yield a value larger than a 32-bit integer, you could use Math.BigMul, then just divide the result and cast it back to an integer. I see, as stated by other answers, .NET's support for 64-bit integers apparently provides all the benefits you'd need that MulDiv formerly would have (and then some).

```
int result = unchecked((int)(System.Math.BigMul(nNumber, nNumerator) / nDenominator));

```