From owner-freebsd-net@FreeBSD.ORG Sun Oct 31 11:28:50 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 22DF616A4CE for ; Sun, 31 Oct 2004 11:28:50 +0000 (GMT) Received: from mail.trippynames.com (mail.trippynames.com [38.113.223.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id EFB0C43D5F for ; Sun, 31 Oct 2004 11:28:49 +0000 (GMT) (envelope-from sean@chittenden.org) Received: from localhost (localhost [127.0.0.1]) by mail.trippynames.com (Postfix) with ESMTP id AC8F6A6C73; Sun, 31 Oct 2004 03:28:49 -0800 (PST) Received: from mail.trippynames.com ([127.0.0.1]) by localhost (rand.nxad.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 16494-01; Sun, 31 Oct 2004 03:28:48 -0800 (PST) Received: from [192.168.1.3] (dsl081-069-073.sfo1.dsl.speakeasy.net [64.81.69.73]) by mail.trippynames.com (Postfix) with ESMTP id 23C29A6C6F; Sun, 31 Oct 2004 03:28:48 -0800 (PST) In-Reply-To: <20041031214441.Q15594@delplex.bde.org> References: <20041031214441.Q15594@delplex.bde.org> Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <05DE5D1C-2B30-11D9-8420-000A95C705DC@chittenden.org> Content-Transfer-Encoding: 7bit From: Sean Chittenden Date: Sun, 31 Oct 2004 03:28:44 -0800 To: Bruce Evans X-Mailer: Apple Mail (2.619) cc: freebsd-net@FreeBSD.org Subject: Re: Irritation regarding precision of ping(8)... X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Oct 2004 11:28:50 -0000 >> This has long bugged me and tonight I finally snapped and had to do >> something about it. Example output: >> >> 64 bytes from a.b.c.d: icmp_seq=935 ttl=126 time=33.824 ms >> 64 bytes from a.b.c.d: icmp_seq=936 ttl=126 time=29.138 ms >> 64 bytes from a.b.c.d: icmp_seq=937 ttl=126 time=28.262 ms >> 64 bytes from a.b.c.d: icmp_seq=938 ttl=126 time=29.67 ms >> 64 bytes from a.b.c.d: icmp_seq=939 ttl=126 time=30.963 ms >> 64 bytes from a.b.c.d: icmp_seq=940 ttl=126 time=30.283 ms >> 64 bytes from a.b.c.d: icmp_seq=941 ttl=126 time=29.455 ms >> >> The source of irritation being line seq 930. The time should be >> 29.670 >> since we are accurately measuring the precision to the thousands >> place. > > I think you mean line seq 938. Yeah... my eyes are getting blurry... the 8 and 0 look similar at the moment... probably a good sign I should stop and crash for the night. > This seems to be a local bug in printf. The correct format for > printing > 3 digits after the decimal point (%.3f) is already used, and printf of > 29.67 with format %.3f gives 29.67 here. Inclined to agree with you... while poking at this I started to get desperate and something tickled the back of my mind about needing a trailing '0' to cause it zero pad data to the right. But, looks like this has long since been fixed (accidentally tested in an old 4.x tree). OS-X has the same bug (so I chased to FreeBSD to fix hoping apple picks up the fix), but, looks like 5.3 (maybe 5.2 too) has this fixed. Please disregard. Must remember to test more before posting, esp late at night. *blush* -sc -- Sean Chittenden