Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!pasteur!ucbvax!decwrl!purdue!i.cc.purdue.edu!j.cc.purdue.edu!pur-ee!uiucdcs!uxc.cso.uiuc.edu!hamilton From: hamilton@uxc.cso.uiuc.edu Newsgroups: comp.sys.ibm.pc Subject: Re: Turbo C bug with unsigned long inte Message-ID: <174200077@uxc.cso.uiuc.edu> Date: 22 Apr 88 01:49:00 GMT References: <2658@im4u.UUCP> Lines: 22 Nf-ID: #R:im4u.UUCP:2658:uxc.cso.uiuc.edu:174200077:000:570 Nf-From: uxc.cso.uiuc.edu!hamilton Apr 21 19:49:00 1988 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