A truncation technique to calculate the Sommerfeld integrals numerically is presented.With the technique,the near-field information included in the integrals is extracted so that complex Sommerfeld integrals can be transformed to certain definite integrals,without any restriction to physical conditions The method proposed here is of fast speed of computation and high precision,and with which wide applications could be found in dealing with the antenna problems in complex layered media.