Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!cmcl2!csd2!dube From: dube@csd2.UUCP (Tom Dube) Newsgroups: net.lang.c Subject: Re: weird C behavior Message-ID: <3090013@csd2.UUCP> Date: Sat, 22-Mar-86 13:01:00 EST Article-I.D.: csd2.3090013 Posted: Sat Mar 22 13:01:00 1986 Date-Received: Tue, 25-Mar-86 02:48:36 EST References: <557@utastro.UUCP> Organization: New York University Lines: 14 >Here is a short C program which gives correct output according to K & R. >While I can't argue it's wrong, it is not transparently right, either. >#include >#define BIG 36864 >int i; >i = BIG; >if (i != BIG) > printf("Equality NOT found: i = %d, BIG = %d\n", i, BIG); Sure it's correct. i is not 36864 because it is forced into a 16 bit integer. The numbers look the same when you print them because you are also forcing BIG into an integer with the format %d. Try printing both numbers with %ld. Tom Dube