Beware: Hackers
Alan S. Driscoll
alan at allegra.UUCP
Mon Jan 9 05:38:19 AEST 1984
>From Roger Ferrel:
What we see here with the:
inttype *= 0.5;
vs
inttype = inttype * 0.5;
is a weakness of most C compilers. It seems none of them handles
float operations very well when there are mixed types. Of course
the above is a poor example since normally more efficent code would
be generated by using:
inttype >>= 1; /* how is this for getting off the subject? */
>From the C Reference Manual:
The value of E1>>E2 is E1 right-shifted E2 bits. The right shift
is guaranteed to be logical (0-fill) if E1 is unsigned; otherwise
it may be arithmetic (fill by a copy of the sign bit).
If the shift is logical, then negative values of "inttype" will give you
interesting results.
Alan S. Driscoll
AT&T Bell Laboratories
More information about the Comp.lang.c
mailing list