C Notes1

C behaves in a confusing way when one or both of the operands to % are negative. In fact, different implementations of C can behave differently in such cases. If you rely on one particular behavior, you might be surprised if you move your program to another computer. To ensure that your programs will work the same way on all machines, you should avoid using % with negative operands    

posted @ 2012-11-24 23:42  HardWay  阅读(121)  评论(0编辑  收藏  举报