Checking if vector is normalized
This seems ok, depending on how precise you want it to be (some margin of error will always be needed since this is floating-point, but how much will depend on your needs)

Alternatively, you could check Math.Abs(1 - len) &lt; 1e-14, but I suspect the same precision problems will remain.

I was somewhat surprised that 1 + 1e-15 equals 1, though, because doubles have 52 bits of precision, which should be more than enough to store a difference of 15 digits (-log2(1/10^15) gives me around 49.8, which is less than 52 bits).

So I double checked and 1 - 1.0e-15 does not give me 1.

class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine(1 - 1.0e-15); //Does NOT print 1
        Console.Read();
    }
}


Same thing for 1 + 1.0e-15 (though this one is trickier)

class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine(1 + 1.0e-15); //Prints 1
        Console.WriteLine(1 + 1.0e-15 == 1); //...but this prints False
        Console.Read();
    }
}


I suspect Console.WriteLine is only printing a limited number of digits: less than the ones double can represent.

As a final note, Sqrt(1) == 1, so instead of using the Length you could use the SquaredLength and save a (potentially expensive) Sqrt operation.