rconn wrote:
| Steve Fábián wrote:
|
|
| ---Quote---
|| nickles wrote:
||| Hi,
|||
||| I recently noticed a bias between the output of
||| 1) PDIR /(zKc sp) and
||| 2) The file sizes reported by Windows.
|||
||| E.g. PDIR /(zKc sp) readme.txt returns "0 E:\temp\down\readme.txt",
||| while Windows - correctly reports - "1 kb" (Explorer). Annotation:
||| DIR readme.txt - also correctly - delivers "28.06.2008 19:04 984
||| readme.txt"
||
|| Verified in TCC 9.02.151 - PDIR always truncates, instead of
|| rounding the fractional part of the reporting unit.
| ---End Quote---
| WAD -- see the documentation for PDIR.
As usual, you are correct. However, here is the strange report of the
command
pdir/(zc 4@filesize[*] zk @filesize[*,k] zK @filesize[*,K] fn)/os
0 0 0 0 0 0 0000.txt
1 1 0 1 0 1 0001.txt
2 2 0 1 0 1 0002.txt
997 997 0 1 0 1 0997.txt
998 998 0 1 0 1 0998.txt
999 999 0 1 0 1 0999.txt
1,000 1000 1 1 0 1 1000.txt
1,001 1001 1 2 0 1 1001.txt
1,002 1002 1 2 0 1 1002.txt
1,003 1003 1 2 0 1 1003.txt
1,004 1004 1 2 0 1 1004.txt
1,022 1022 1 2 0 1 1022.txt
1,023 1023 1 2 0 1 1023.txt
1,024 1024 1 2 1 1 1024.txt
1,025 1025 1 2 1 2 1025.txt
1,026 1026 1 2 1 2 1026.txt
1,027 1027 1 2 1 2 1027.txt
1,028 1028 1 2 1 2 1028.txt
Notice the zS (where S is a magnitude prefix) truncates (equivalent to using
the FLOOR function), while %@filesize[*,S] rounds up even 1 byte (as the
CEILING functon does). In many situations one would like to have something
closer to the rounding done by @EVAL.
--
Steve