While solving this problem, I accidentally introduced a bug into my program. If it saw that two temperatures differed in sign, it would always take the positive one -- even if it was further from zero. This was clearly the wrong thing to do. But, surprisingly, my "solution" still passed!
A test case where the input closest to zero is negative would have caught this error. Something like
(My program is published if you want to have a look. The older version is the one with the bug.)