|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
the modulus operator in Windriver C++
Would someone with ready access to Windriver C++ please run the following short program and post whether it returns "-179" or "+181" ? Code:
void main (void) {
signed int err;
err=(-179)%360;
printf("err=%d",err);
}
Thanks. |
|
#2
|
||||
|
||||
|
Re: the modulus operator in Windriver C++
Page 82 of ISO/IEC 9899:TC3 (attached) shows that
(-179)%360 must be -179 Last edited by Ether : 10-02-2011 at 15:55. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|