because of the above default of wrapping - here you might have some strange results. 
If you getLengthAtIndexInterpolated with the last index say 50.5 ( num pts is 51 ) you'll get an interpolation between the first and last point. The resulting length will be halfway along the line.