[test][distance] make sure sqrt is called with a double argument (to avoid problems with VS2010 that does not promote ints to doubles in sqrt)