module integer_sqrt

  implicit none
  interface sqrt
    module procedure sqrt_int
  end interface

  contains

  function sqrt_int(i) result (sqrt_int_result)

    integer :: sqrt_int_result
    integer, intent(in) :: i

    sqrt_int_result = int(sqrt(real(i) + 0.5))

  end function sqrt_int

end module integer_sqrt

program test_integer_sqrt

  use integer_sqrt
  implicit none
  integer :: i

  do i = 1,25
    print "(2i5)", i, sqrt(i)
  enddo

end program test_integer_sqrt
