'^^' and 'div/mod'...

Thomas M. Breuel breuel at harvard.ARPA
Mon Nov 12 10:44:37 AEST 1984


I don't see the difference between 'if(!a!=!b)...' and
'if(!!a!=!!b)...'.  What for do you need two negations?

About computing div and mod at the same time, this is so processor
dependent that it is probably best if you either use inline assembly
language (if supported) or write a short assembly language subroutine
to do it. A good optimising compiler should, btw, notice that you seem
to be using a value which has already been computed. Whether it can do
anything about it depends on its recklessness and the presence of
side-effects in the two subexpressions. If, on the other hand, your two
subexpressions are really complicated (e.g. involving procedure calls
:-) then the cost of assigning them to temporary variables is
negligible in comparison anyhow.

Syntax for computing and using sin and cos at the same time is provided
by complex variables. Now, if you want to add them to 'C'...

Altogether, I don't think that syntax for multiple return values is
warranted in a systems programming language. Even languages like 'Lisp'
and 'fp' have problems with them (mostly efficiency problems).

						Thomas.
						(breuel at harvard)



More information about the Comp.lang.c mailing list