Path: utzoo!attcan!uunet!lll-winken!ncis.llnl.gov!helios.ee.lbl.gov!pasteur!agate!bionet!csd4.milw.wisc.edu!nic.MR.NET!xanth!ukma!husc6!cmcl2!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: Turbo C bug ! Message-ID: <9487@smoke.BRL.MIL> Date: 23 Jan 89 21:08:27 GMT References: Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 9 In article pk-tle@sics.se (Tommy Levitte) writes: >(57600 = 240*240 !!!!!!!) Not with 16-bit ints, it doesn't. 240*240 overflows a 16-bit int, with generally unpredictable results. Apparently Turbo C treated the result as -7936, which is what you get on "silent" overflow on a 2's-complement 16-bit machine. That's permissible. As you noted, forcing the computation to be done using longs avoids the overflow.