Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!pacbell!sactoh0!smcroft From: smcroft@sactoh0.UUCP (Steve M. Croft) Newsgroups: comp.sys.ibm.pc Subject: Re: correct code for pointer subtraction Message-ID: <607@sactoh0.UUCP> Date: 5 Jan 89 14:40:52 GMT References: <5137@phoenix.Princeton.EDU> Organization: Sacramento Public Access, Ca. USA Lines: 22 In article <5137@phoenix.Princeton.EDU>, rjchen@phoenix.Princeton.EDU (Raymond Juimong Chen) writes: > > There is an overflow in there. > > Exactly. And the compiler should be smart enough to emit code to handle > the overflow so as to generate the "correct" answer. At what point should the compiler not be expected to fix overflow problems? Whadda 'bout: int a; a = (30000*30000*30000*30000*30000*30000)/(30000*30000*30000*30000*30000) This involves more than resolving the carry bit, as was earlier suggested.. Cheers! steve -- ############################################################### # steve "whadda guy" croft # # ...!pacbell!sactoh0smcroft || ...csusac!athena!crofts # ###############################################################