From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4778 Path: news.gmane.org!not-for-mail From: Morten Welinder Newsgroups: gmane.linux.lib.musl.general Subject: printf issues Date: Fri, 4 Apr 2014 09:32:18 -0400 Message-ID: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1396618360 2974 80.91.229.3 (4 Apr 2014 13:32:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 4 Apr 2014 13:32:40 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-4782-gllmg-musl=m.gmane.org@lists.openwall.com Fri Apr 04 15:32:34 2014 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 1WW4ES-0008KQ-7v for gllmg-musl@plane.gmane.org; Fri, 04 Apr 2014 15:32:32 +0200 Original-Received: (qmail 32532 invoked by uid 550); 4 Apr 2014 13:32:30 -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 32524 invoked from network); 4 Apr 2014 13:32:30 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=RLm4pdpmgyJZUlkSXdBn8AdRq+jyrLpHhMK615gq0eo=; b=K1PLEczCWaz2Mo8CUkjkP15HZ+cOz24Tf5Z18nMGQIHRZrQfgudnExOcN2ATSDwArs XGanhgDG45uIjuctDdbmcdCChit78OlAawXZ55H8cH/aDkehY2e+IbevIEdLnzxTC4Dz 8tCyFO6YrYzOzVsCE9OIfhqMHwauxK3SHqUFkKg+eGIzvxVCWeb3gm4ZqWQjqrB04ggE d6NpZNNnlUYoeq2bgf5RpvDRvLizTVE0xnvXTR5X1eu2dVUAd+uzheD1bZ8cpBU4t0ah GGUD2T702j2zvw/pSXtPRIqXN+NKVHIDj5TMhDMqyShwgcohNaqi63hGHygHX0oyc9Ze 18uQ== X-Received: by 10.180.101.40 with SMTP id fd8mr4605422wib.1.1396618338792; Fri, 04 Apr 2014 06:32:18 -0700 (PDT) Xref: news.gmane.org gmane.linux.lib.musl.general:4778 Archived-At: I am seeing differences in how printf("%.200Lg",val) works between musl code and glibc. Here are some samples. The top line is how musl prints, the bottom is glibc. -65878995336522048.000000000 -65878995336522048 1954675876964773.500000000 1954675876964773.5 3953605802361882.000000000 3953605802361882 Unrelatedly, from function fmt_fp: #define CONCAT2(x,y) x ## y #define CONCAT(x,y) CONCAT2(x,y) [...] long double round = CONCAT(0x1p,LDBL_MANT_DIG); That code is cute as a Hello Kitty door knocker, but really? Let's hope nobody gets the urge to define LDBL_MANT_DIG as 0100 or (80-16) or some such. The first case will still compile, but get the wrong result. Morten