Michael Käppler <xmichae...@web.de> writes:

> Nevertheless, please test and critizize!

> +inline int
> +shift_left (int value, int shiftamount)
> +{
> + if (shiftamount < 0) return (value >> abs(shiftamount)); 
> +  else return (value << shiftamount);
> +}

I would not use abs(shiftamount) here, but -shiftamount since you
already tested the sign.

Also the comment is misleading: x << -2 is _not_ necessarily zero as the
comment proclaims, but rather is unspecified IIRC.  It _could_ have
worked by chance and/or the whim of the compiler writers.

-- 
David Kastrup



_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to