The need for D-scussion (was Re: D Wishlist)

Karl Heuer karl at haddock.ISC.COM
Tue Mar 15 10:35:59 AEST 1988


In article <3732 at bloom-beacon.MIT.EDU> tada at athena.mit.edu (Michael Zehr) writes:
>a function the returns both a % b and a / b at the same time.

ANSI C has two flavors of this, in function form: div() and ldiv().  The
return value is a structure, which makes it a bit awkward to use if you want
both results.  Also, unlike the / and % operators, the result is well-defined
(guaranteed vax-like) for negative numbers, so it is not necessarily identical
to the pair {a/b, a%b}.

Karl W. Z. Heuer (ima!haddock!karl or karl at haddock.isc.com), The Walking Lint



More information about the Comp.lang.c mailing list