The precision for a double is 15-16 digits. This is why, when you used a double, you only got 8 decimal places. Decimals are accurate to 28-29 significant figures which is why you got more decimal places than you wanted. If you want to match the Windows calculator and have 9 decimal places, you can use the decimal
type and use Decimal.Round() to set it to 9 decimal places.
decimal a = 88888888;
decimal b = 9;
decimal c = 0;
Console.WriteLine("a / b is: {0}", Decimal.Round(c = a / b, 9) );
Console.ReadLine();
Edit -
The reason the Windows calculator shows a different degree of accuracy is because it uses an arbitrary-precision arithmetic library
. From Wikipedia.
In Windows 95 and later, it uses an arbitrary-precision arithmetic library, replacing the standard IEEE floating point library. It offers bignum precision for basic operations (addition, subtraction, multiplication, division) and 32 digits of precision for advanced operations (square root, transcendental operators).
The C# compiler doesn't use the same arbitrary-precision library which likely explains the difference in results.