Approximation of real matrices by integral matrices