In cases such as #define a(x) 2x
Therefore whenever you call a(x)
it behaves as a function and returns the value of 2x therefore if you write a(5) then it will return 10
Similiary just treat the above given define instructions as function declaration.
this program demostrates segmented sieve , fast and memory efficient version of sieve ,
if we store whole array position to store one flag , it is inefficient ,
we are storing each 32 bit to store 1 flag which reduces memory complexity by a factor of 1/32 .
now you have used 2 macros
ifc will check if the bitflag is 1 OR 0 …
isc will set specific bit position 1
any nth value is located at (n/32)th position
and (n%32)th bit from LSB
but since we are neglecting odd nth value flag changes to (n/64)th position .
and bit position is (n/2)%32 which is same as (n>>1)&31
mode with a power of 2 is same as ANDing with (same power of 2)-1
It just makes your code more readable and understandable. What’s the role a function, instead of writing the same code again and again just pass a value to the function and get the desired result similarly define can be sought to be a small function