[TUHS] re: unsigned division in V7's C

Dennis Ritchie dmr at plan9.bell-labs.com
Sat Jan 11 17:32:41 AEST 2003


Helbig observed

  > while wondering how unsigned integer division is implemented in C
  > I found a bug in V7: a/b and a%b with b >= 2^15 does not give the expected
  > results, if a and b are unsigned int's.

Does

  http://www.cs.bell-labs.com/who/dmr/odd.html#muldiv

suffice to explain the behavior?

	Dennis




More information about the TUHS mailing list