I've noticed that C# appears to interpret 1 000 000 000 and 1e9 somewhat differently.
For example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Threading;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Stopwatch stopwatch = new Stopwatch();
stopwatch.Start();
for (int i = 0; i < 1000000000; i++)
{
}
stopwatch.Stop();
Console.WriteLine("Time elapsed: {0}", stopwatch.Elapsed);
Console.ReadKey();
}
}
}
The code measures the time it takes for the computer to count to one billion. On my machine it takes approximately 4,08 seconds (moving the mouse increases this time, so I don't move it).
However, if I express one billion as 1e9 the time required for the computer to go through the code drops to 3,65.
That is around 10% difference. Can anybody offer an explanation?
Thanks
