From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/642 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: libm Date: Sat, 10 Mar 2012 17:38:38 +0100 Message-ID: <20120310163837.GY5728@port70.net> References: <20120305085135.GC5728@port70.net> <20120305140459.GW184@brightrain.aerifal.cx> <20120305151710.GG5728@port70.net> <20120309102239.GC184@brightrain.aerifal.cx> <20120309110946.GU5728@port70.net> <20120309155655.GD184@brightrain.aerifal.cx> <20120309170254.GG184@brightrain.aerifal.cx> <20120310032844.GH184@brightrain.aerifal.cx> <20120310124552.GW5728@port70.net> <20120310131245.GI184@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1331397536 25830 80.91.229.3 (10 Mar 2012 16:38:56 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 10 Mar 2012 16:38:56 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-643-gllmg-musl=m.gmane.org@lists.openwall.com Sat Mar 10 17:38:55 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1S6PJj-0003xK-8X for gllmg-musl@plane.gmane.org; Sat, 10 Mar 2012 17:38:51 +0100 Original-Received: (qmail 19698 invoked by uid 550); 10 Mar 2012 16:38:50 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 19690 invoked from network); 10 Mar 2012 16:38:50 -0000 Content-Disposition: inline In-Reply-To: <20120310131245.GI184@brightrain.aerifal.cx> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:642 Archived-At: * Rich Felker [2012-03-10 08:12:45 -0500]: > On Sat, Mar 10, 2012 at 01:45:53PM +0100, Szabolcs Nagy wrote: > > for two argument functions __RETCAST((x)+(y)) is not ok > > if x is float, y is int then the return type should be double, not float > > (this can be solved by a __RETCAST2(x,y) i guess) > > I don't see any better way right off... i committed a solution handling all the combinations turned out to be quite tricky > Actually it's really ugly that C's promotions don't respect the size > of the integer type when combining with floating point types. x+0.0f i'd say that the ugly thing is that they added tgmath.h eventhough there is no good way to do type generics in c the implicit type conversions and promotions are already hard to tackle in c so one should be careful anyway (and use explicit casts when not sure) > It would probably be nice to put the case for double before long > double to avoid going through an extra wrapper function on LD64 > systems, but it's not a big deal. i made the long double conditions false whenever sizeof(double) == sizeof(long double) so on LD64 only double functions will be used