lundi 10 octobre 2016

Implement Conditional "if" Using Only Bitwise Logic and Arithmetic Operations

This is a curiosity to me. Could a conditional "if" statement such as if ___ do ___ be implemented in C purely with bitwise logical operators and some arithmetic operators?

Is this possible if one were limited to the ! ~ & ^ | + - * / % << >> operators and 32bit signed int ? No conditionals, loops, functions, etc ...

This is not HW but I was inspired to ask this because of a problem set.

Aucun commentaire:

Enregistrer un commentaire