fixes low precision of printed results

If the distance matrix contains values smaller than 0.001
we now use scientific notation for the output to increase the
presicion.