answersLogoWhite

0

The best way I can explain this is to give you an example of code with no documentation. If there was documentation, you would be able to tell what this code did in a matter of seconds. Without it you could waste many minutes, or even hours, trying to understand it.

inline unsigned char f_1(const unsigned char *ptr, const unsigned int i) {

const div_t d = div(i, 8);

return (ptr[d.quot] & (1 << d.rem))?1:0;

}

inline void f_2(unsigned char *ptr, const unsigned int i) {

const div_t d = div(i, 8);

ptr += d.quot;

*ptr = *ptr | (1 << d.rem);

}

inline void f_3(unsigned char *ptr, const unsigned int i) {

const div_t d = div(i, 8);

const unsigned char n = 1 << d.rem;

ptr += d.quot;

*ptr = ((*ptr | n ) ^ n);

}

void f(const unsigned int n) {

const unsigned int m = n + (n%8==0?0:8-n%8);

const unsigned int n = m / 8;

const unsigned int m_2 = m / 2;

unsigned int i, j;

unsigned char *a = malloc(sizeof(unsigned char) * n);

memset(a, 0xaa, n);

f_3(a, 1);

f_2(a, 2);

for( i = 3; i < m_2; i+=2 ) {

while(i < m_2 && !f_1(a, i))

i+=2;

for( j = i + i; j < m; j+=i )

f_3(a, j);

}

free(a);

}

User Avatar

Wiki User

17y ago

What else can I help you with?

Related Questions

What documentation do I need to reside in an emergency shelter in Chicago?

You should not need any documentation to receive help from an emergency shelter.


What documentation do you need to vote?

your ID!


Do you need documentation to travel to Singapore?

no


What documentation you need to get a passaport?

You need your full birth certificate


If you been separated from your spouse but did it because of abuse do you need legal documentation for that?

If you been separated from your spouse but did it because of abuse do you need legal documentation for that?


If you are in work probation less then a month do you need any documentation?

WHAT kind of documentation? If you are asking whether you need to present proof that you are employed - yes you do.


Is the phrase Need more detail documentation correct in a sentence?

No. It lacks a subject. Also, "detail documentation" is obscure. Perhaps you mean detailed documentation.


What do borrowers need to provide when applying for no documentation loans?

Even though no documentation loans by definition do not require any documentation, the prospective applicant still needs to provide some proof of income.


Why does one need proper documentation for a business?

It is good practice for an organization/company to enforce proper documentation for its operations maintenance and sustenance purposes.


Do you need to be documented to be fingerprinted?

No finger printing is an extreme form of documentation


What documentation do you need to prove purchase without title?

Bill of Sale


What documentation does a teenager need to travel from Georgia to mexico?

Only a passport.