View Single Post
  #1   Spotlight this post!  
Unread 02-02-2011, 12:54
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,062
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
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);
}
The old C compiler I have here returns -179, but I am told that newer compilers return +181.

Thanks.


Reply With Quote