C language hacking

Doug Gwyn <gwyn> gwyn at brl-tgr.ARPA
Mon Nov 12 06:31:40 AEST 1984

As long as we're proposing our favorite extensions to C (not that
they should be in the forthcoming ANSI standard, but perhaps the
standard should anticipate that these extensions might be made
some day):

I find that frequently I need both the quotient and remainder of
two integers:	a / b	a % b
Since most (maybe all) machine architectures compute these at the
same time, it sure would be nice to be able to get both results
rather than wastefully reexecuting precisely the same instructions
a second time.  This becomes particularly bothersome when "a" & "b"
are fairly complicated expressions.  I have no idea what a good
syntax for such an operation would be.

It would also be nice if sin( x ) and cos( x ) could be computed
simultaneously with reduced cost.  I doubt if this is possible
but would like to know if it is.

More information about the Comp.lang.c mailing list