logoalt Hacker News

paulddraperyesterday at 9:41 PM0 repliesview on HN

It's an IEEE-754 oddity that Python chose to adopt for its equality.

IEEE-754 does remainder(5, 3) = -1, whereas Python does 5 % 3 = 2.

There's no reason to expect exact equivalence between operators.