math sanity check

Post Reply
Malcolm
Posts: 32040
Joined: Fri May 21, 2004 1:04 pm
Location: Minneapolis

Post by Malcolm »

Alright, granted it's been a long time since I'd to prove this from first principles...but -1 modulo 10 is still 9, right?

Then why the fuck does C# think -1 % 10 yields -1?

After some brief Googling, the answer appears to be, "because FORTRAN did it."
Diogenes of Sinope: "It is not that I am mad, it is only that my head is different from yours."
Arnold Judas Rimmer, BSC, SSC: "Better dead than smeg."
Post Reply