We propose two methods of estimating a systematic error in extrapolation to the infinite-size limit in the study of measuring the Haldane gaps of the one-dimensional Heisenberg antiferromagnet with the integer spin up to S=5. The finite-size gaps obtained by numerical diagonalizations based on Lanczos algorithm are presented for sizes that have not previously been reported. The changes of boundary conditions are also examined. We successfully demonstrate that our methods of extrapolation work well. The Haldane gap for S=1 is stimated to be $0.4104789 \pm 0.0000013$. We successfully obtain the gaps up to S=5, which make us confirm the asymptotic formula of the Haldane gap in $S\to\infty$.