conversion of short to unsigned it

darryl at ISM780.UUCP darryl at ISM780.UUCP
Wed Mar 20 15:43:56 AEST 1985


[Stop me before I quote again!]

K&R, page 184, section 6.6, "Arithmetic Conversions":

    "A great many operators cause conversions and yield result types in
a similar way.  This pattern will be called the "usual arithmetic
conversions".

    "First, any operands of type char or short are converted to int, and any
of type float are converted to double.
	:
	:
	:
    "Otherwise, if either operand is unsigned, the other is converted to
unsigned and that is the type of the result.
	:
	:
	:

The new version of the C reference manual supplied with system V changes
the results in the case of long x unsigned;  in K&R, this results in a long,
but now it is an unsigned long (is there any real difference?).

	    --Darryl Richman, INTERACTIVE Systems Corp.
	    ...!cca!ima!ism780!darryl
	    The views expressed above are my opinions only.



More information about the Comp.lang.c mailing list