Re: df displays 0.

From: Tim Robbins <tjr_at_FreeBSD.ORG>
Date: Mon, 14 Apr 2003 20:32:57 +1000
On Mon, Apr 14, 2003 at 12:05:16PM +0200, Christoph Kukulies wrote:

> 
> Is this normal?:
> 
> www# df
> Filesystem  1K-blocks     Used    Avail Capacity  Mounted on
> /dev/ad0s1a    257838    72384   164828    31%    /
> devfs               1        1        0   100%    /dev
> /dev/ad0s1e    257838       22   237190    0.%    /tmp
> /dev/ad0s1f  57829724 12064820 41138528    23%    /usr
> /dev/ad0s1d    257838     8686   228526     4%    /var
> 
> I mean, the 0. percent on /tmp .

This is probably another problem with vfprintf()'s new floating point code.
I'm seeing the same problem here now that I've rebuilt /bin/df with a recent
libc. Here's a test program that demonstrates the problem. It's worth pointing
out that 0.0 is printed correctly as "0%", but 0+eps is printed as "0.%".

#include <float.h>
#include <stdio.h>
#include <stdlib.h>

int
main(int argc, char *argv[])
{

	printf("%5.0f%%\n", 0.0);
	printf("%5.0f%%\n", DBL_EPSILON);
	exit(0);
}
Received on Mon Apr 14 2003 - 01:33:40 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:03 UTC