Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 Oct 2004 03:28:44 -0800
From:      Sean Chittenden <sean@chittenden.org>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        freebsd-net@FreeBSD.org
Subject:   Re: Irritation regarding precision of ping(8)...
Message-ID:  <05DE5D1C-2B30-11D9-8420-000A95C705DC@chittenden.org>
In-Reply-To: <20041031214441.Q15594@delplex.bde.org>
References:  <EE1B194A-2B21-11D9-8420-000A95C705DC@chittenden.org> <20041031214441.Q15594@delplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
>> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?05DE5D1C-2B30-11D9-8420-000A95C705DC>