This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gsubr.c: C << operator question.


At the risk of being just one of several people to answer...

>>>>> Karl M Hegbloom writes:

 KMH>  I'm still learning C as well as scheme.  Can someone help me
 KMH> understand this bit of code, please?

[...]

 KMH>  ... Why does it first << 8 and then right away do >> 8,
 KMH> recompute and compare like that?  How could the value change?

(x << 8) >> 8 == x with the top 8 bits cleared

-- 
 Gordon Matzigkeit <gord@fig.org> //\ I'm a FIG (http://www.fig.org/)
    Lovers of freedom, unite!     \// I use GNU (http://www.gnu.org/)

Copyright (C) 1998 FIG.org; the creator offers you this gift and wants it
to remain free.  See http://www.fig.org/freedom.html for details.
  This work may be copied, modified and distributed under the GNU General
  Public License (GPL).  See http://www.gnu.org/copyleft/gpl.html.