GNU bug report logs - #8320
df -BT: rounding error?

Previous Next

Package: coreutils;

Reported by: "Voelker, Bernhard" <bernhard.voelker <at> siemens-enterprise.com>

Date: Tue, 22 Mar 2011 16:07:02 UTC

Severity: normal

Tags: notabug

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 8320 in the body.
You can then email your comments to 8320 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#8320; Package coreutils. (Tue, 22 Mar 2011 16:07:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Voelker, Bernhard" <bernhard.voelker <at> siemens-enterprise.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Tue, 22 Mar 2011 16:07:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Voelker, Bernhard" <bernhard.voelker <at> siemens-enterprise.com>
To: "bug-coreutils <at> gnu.org" <bug-coreutils <at> gnu.org>
Subject: df -BT: rounding error?
Date: Tue, 22 Mar 2011 16:47:41 +0100
Running `df -B...` with a SIZE which is greater than the total disk space
returns the same value in the 'Used' and 'Available' column - see example
below with T, P and E:

$ for f in 1 K M G T P E Z Y ; do ( set -x && df -B$f . ) ; done
+ df -B1 .
Filesystem           1B-blocks      Used Available Use% Mounted on
D:                   596087726080 100868861952 495218864128  17% /cygdrive/d
+ df -BK .
Filesystem           1K-blocks      Used Available Use% Mounted on
D:                   582116920K 98504748K 483612172K  17% /cygdrive/d
+ df -BM .
Filesystem           1M-blocks      Used Available Use% Mounted on
D:                     568474M    96197M   472278M  17% /cygdrive/d
+ df -BG .
Filesystem           1G-blocks      Used Available Use% Mounted on
D:                        556G       94G      462G  17% /cygdrive/d
+ df -BT .
Filesystem           1T-blocks      Used Available Use% Mounted on
D:                          1T        1T        1T  17% /cygdrive/d
+ df -BP .
Filesystem           1P-blocks      Used Available Use% Mounted on
D:                          1P        1P        1P  17% /cygdrive/d
+ df -BE .
Filesystem           1E-blocks      Used Available Use% Mounted on
D:                          1E        1E        1E  17% /cygdrive/d
+ df -BZ .
df: -B argument `Z' too large
+ df -BY .
df: -B argument `Y' too large

Apart from saying that 1[TPE] is still available ... shouldn't it return
0[TPE] for the "Used" column, as rounding a value of 17% should lead to
zero (mathematically)?

BTW: why are `Z' and `Y' "too large"?

$ df --version
df (GNU coreutils) 8.10
Packaged by Cygwin (8.10-1)

It's on a 32-bit XP.

Have a nice day,
Berny



Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#8320; Package coreutils. (Tue, 22 Mar 2011 16:48:01 GMT) Full text and rfc822 format available.

Message #8 received at 8320 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: "Voelker, Bernhard" <bernhard.voelker <at> siemens-enterprise.com>
Cc: 8320 <at> debbugs.gnu.org
Subject: Re: bug#8320: df -BT: rounding error?
Date: Tue, 22 Mar 2011 09:47:42 -0700
On 03/22/2011 08:47 AM, Voelker, Bernhard wrote:
> shouldn't it return
> 0[TPE] for the "Used" column, as rounding a value of 17% should lead to
> zero (mathematically)?

df always rounds up, rather than to nearest.
I vaguely recall that POSIX specifies that, for -k.

> BTW: why are `Z' and `Y' "too large"?

They don't fit in 64 bits.




Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#8320; Package coreutils. (Tue, 22 Mar 2011 17:22:01 GMT) Full text and rfc822 format available.

Message #11 received at 8320 <at> debbugs.gnu.org (full text, mbox):

From: "Voelker, Bernhard" <bernhard.voelker <at> siemens-enterprise.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: "8320 <at> debbugs.gnu.org" <8320 <at> debbugs.gnu.org>
Subject: RE: bug#8320: df -BT: rounding error?
Date: Tue, 22 Mar 2011 18:21:17 +0100
Paul Eggert wrote:

> On 03/22/2011 08:47 AM, Voelker, Bernhard wrote:
>> BTW: why are `Z' and `Y' "too large"?
>
>They don't fit in 64 bits.

wow, I wasn't aware that there are already 128-bit systems!

Bye,
Berny




Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#8320; Package coreutils. (Sun, 17 Apr 2011 06:40:03 GMT) Full text and rfc822 format available.

Message #14 received at 8320 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: "Voelker\, Bernhard" <bernhard.voelker <at> siemens-enterprise.com>
Cc: Paul Eggert <eggert <at> cs.ucla.edu>,
	"8320 <at> debbugs.gnu.org" <8320 <at> debbugs.gnu.org>
Subject: Re: bug#8320: df -BT: rounding error?
Date: Sun, 17 Apr 2011 08:39:53 +0200
tags 8320 notabug
close 8320
thanks

Voelker, Bernhard wrote:
> Paul Eggert wrote:
>> On 03/22/2011 08:47 AM, Voelker, Bernhard wrote:
>>> BTW: why are `Z' and `Y' "too large"?
>>
>>They don't fit in 64 bits.
>
> wow, I wasn't aware that there are already 128-bit systems!

Hi Voelker,
It looks like this is resolved, and is not a bug,
so I've closed the issue.  You're welcome to reopen it
if you're not satisfied with that.




Added tag(s) notabug. Request was from Jim Meyering <jim <at> meyering.net> to control <at> debbugs.gnu.org. (Sun, 07 Aug 2011 16:58:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 8320 <at> debbugs.gnu.org and "Voelker, Bernhard" <bernhard.voelker <at> siemens-enterprise.com> Request was from Jim Meyering <jim <at> meyering.net> to control <at> debbugs.gnu.org. (Sun, 07 Aug 2011 16:58:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 05 Sep 2011 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 341 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.