Here as explained in the video
suppose the segmented sieve is from 99 to 144
so m=99 and n=144
index of segmented sieve must start from (m-m) i. e: =0
In the code
int start = (m/x)*x; // This equals to (99/2)*2 = 98
Now //in marking all multiples code
for(int i = start ; i <= n ; i+=x ){ //Here i = 98
segment [ i-m ] = 1 ; // Here ( i - m ) = ( 98 - 99 ) = -1
}
So there won’t be an indexing error in the code ???