invalid operands of types 'float' and 'int' to binary 'operator%'

CoDGAS:
I think i've fixed the code tags

You missed one part:

CoDGAS:
ive also tried values[x] & 1 == 1, gets me the error "invalid operands of types 'float' and 'bool' to binary 'operator&'"

That makes absolutely no sense because the forum interpreted some of your code as markup. If you had used code tags:

CoDGAS:
ive also tried

values[x] & 1 == 1

gets me the error "invalid operands of types 'float' and 'bool' to binary 'operator&'"

It would display as intended.