Share your repls and programming experiences

← Back to all posts
Equals-less Equals with bitwise XOR (python) #WEEKLY
RohanRajagopal (1)

My submission for the challenge. It works by dividing the number into integer and decimal parts, then it compares the integer parts of both number, followed by the decimal part. The comparison is done by converthing each number to binary, than iterating over the bits and XORing then.

Edit: Now works with negatives by catching a ValueError when attempting to take square root of number