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: 
This is an enhancement to Hans Passant sugestion, but including the +0.5 rounding as per MSDN docs:

```
public static int MulDiv(int number, int numerator, int denominator)
{
    return (int)(((long)number * numerator + (denominator >> 1)) / denominator);
}

```

**Note:** This code uses right-shift operator to obtain top performance.
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));

```