function error_frobenius = r8mat_is_integer ( m, n, a )

%*****************************************************************************80
%
%% r8mat_is_integer() checks whether A has only integer entries.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    08 April 2017
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer M, N, the row and column dimensions of 
%    the matrix.  M and N must be positive.
%
%    real A(M,N), the matrix.
%
%  Output:
%
%    real ERROR_FROBENIUS, the Frobenius norm of the
%    difference between A and the nearest integer matrix.
%
  error_frobenius = 0.0;

  for i = 1 : m
    for j = 1 : n
      t = a(i,j) - round ( a(i,j) );
      error_frobenius = error_frobenius + t * t;
    end
  end

  error_frobenius = sqrt ( error_frobenius );

  return
end
