From owner-freebsd-standards@FreeBSD.ORG Sun Sep 5 19:36:41 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 48ABB16A4D0 for ; Sun, 5 Sep 2004 19:36:41 +0000 (GMT) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.208.78.105]) by mx1.FreeBSD.org (Postfix) with ESMTP id 122BE43D46 for ; Sun, 5 Sep 2004 19:36:41 +0000 (GMT) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) i85JaeS9037237 for ; Sun, 5 Sep 2004 12:36:40 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost)i85JaeQe037236 for freebsd-standards@freebsd.org; Sun, 5 Sep 2004 12:36:40 -0700 (PDT) (envelope-from sgk) Date: Sun, 5 Sep 2004 12:36:40 -0700 From: Steve Kargl To: freebsd-standards@freebsd.org Message-ID: <20040905193640.GA37190@troutmask.apl.washington.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Subject: is printf() broken? X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Sep 2004 19:36:41 -0000 The following program #include int main(void) { int d; double x; x = 1.234E05; for (d = 0; d < 5; d++) printf("%+-31.*e\n", d, x); return 0; } generates +1e+05 +1.2e+05 +1.23e+05 +1.234e+05 +1.2340e+05 The question is whether the first number should be "+1.e+05". That is, is the printing of the decimal point required or optional? I only have Harbison and Steele's book and it does not state what the expected behavior should be. -- Steve