i'm trying to figure out what is the fastest way to do an odd / even check on numbers i don't know whether there is a mathematical way of achieving this i've heard that the fastest would be checking the last bit in the binary array but i wonder what % does for example

if(b%2!=0) then odd

does % do divisions till it finds the result that's why i ask

How it is actually done I dunno.
But if I would write a routine that does it I would continuously subtract 2 from b until zero or until b<2 and return that value.

but it doesn't seem to work proper with some test files since it alway ends up at odd() what am i doing wrong b is alway an integer and positive what should i change