Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!linus!philabs!cmcl2!seismo!brl-tgr!gwyn From: gwyn@brl-tgr.ARPA (Doug Gwyn ) Newsgroups: net.lang.c Subject: C language hacking Message-ID: <5715@brl-tgr.ARPA> Date: Sun, 11-Nov-84 15:31:40 EST Article-I.D.: brl-tgr.5715 Posted: Sun Nov 11 15:31:40 1984 Date-Received: Tue, 13-Nov-84 01:18:19 EST Distribution: net Organization: Ballistic Research Lab Lines: 17 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.