Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Sun, 27 May 2012 12:55:29 -0500 Message-ID: <4FC26A8F.5DEB@mindspring.com> Date: Sun, 27 May 2012 13:55:27 -0400 From: pete Reply-To: pfiland@mindspring.com Organization: PF X-Mailer: Mozilla 3.04Gold (WinNT; I) MIME-Version: 1.0 Newsgroups: comp.lang.c Subject: Re: Open letter to Ian Collins References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 26 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 4.154.221.107 X-Trace: sv3-cHPPJMbacR6vk8vKGQxdmgqdDvLl+XkWTIZTIUqKkCOLHz3/kNqYrE3VKJpRMAHGz2uZjCdqtcFni/p!AT0VALPAHjfffoKKWZW9BcdA5vcEhWf0U9TFWfpbxG468fPZyEGk/EQpPmiL0OOBQ3ip4MWzEfvN!Yyk9WHSCj/E= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 1936 Xref: csiph.com comp.lang.c:21417 Keith Thompson wrote: > > Ian Collins writes: > > On 05/27/12 09:12 PM, jacob navia wrote: > [...] > >> With the generic qsort function you would directly compare > >> the data (without function calls) by specifying a macro > >> for comparing your data. For integers it would be simply > >> > >> a - b > > > > That will be interesting to see. > > Especially for values like a==INT_MIN, b==INT_MAX. I think there's about a zillion combinations of (a) and (b), where (a - b) has problems. If (b) is negative, then (a - b) will be undefined whenever (a > b + INT_MAX). If (b) is positive then (a - b) will be undefined whenever (a < b + INT_MIN). -- pete