[comp.sys.ibm.pc] Turbo C bug with unsigned long inte

hamilton@uxc.cso.uiuc.edu (04/22/88)

demelo@im4u says:
> ... To do this I wrote:
> 
> 		unsigned long variable;
> 		...
> 		variable = 1 << num_shift;
> 
> 	where :  num_shift < 32;
> 
> 	The problem is that if num_shift is higher than 14, I get
> (I suppose so) unnexpected results.

    try:
		variable = 1L << num_shift;
			    ^

	wayne hamilton
	U of Il and US Army Corps of Engineers CERL
UUCP:	{ihnp4,seismo,pur-ee,convex}!uiucuxc!hamilton
ARPA:	hamilton@uxc.cso.uiuc.edu	USMail:	Box 476, Urbana, IL 61801
CSNET:	hamilton%uxc@uiuc.csnet		Phone:	(217)333-8703
CIS:    [73047,544]			PLink:  w hamilton