INT XOFSET = INT ((Speed [k] -speed [0]) / (speted [m_analdatafilenum-1] -speed [0]) * xdistance); where the speed type is long
After compiling, debugging actually when k = 0, the value of Xoffset is 4, I don't know why, ask how to solve it.