A just out of curiosity question re @DiskTotal

May 24, 2010
855
0
Northlake, Il
As always, an example:
Code:
[Z:\]Echo %@Comma[%@Eval[%@DiskTotal[C:,k]+%@DiskTotal[D:,k]+%@DiskTotal[E:,k]]]
491,514,744

[Z:\]Echo %@Comma[%@Eval[%@DiskTotal[C:,m]+%@DiskTotal[D:,m]+%@DiskTotal[E:,m]]]
491,513
The question is, of course, how there can be fewer megabytes than kilobytes, particularly when the the number of kilobytes has the value that it has ...m744]? What am I missing here?
 

samintz

Scott Mintz
May 20, 2008
1,555
26
Solon, OH, USA
Most likely it's due to truncation error. Display the individual disk totals, then the sum and see if it's different.
Code:
Echo %@DiskTotal[C:,kc] %@DiskTotal[D:,kc] %@DiskTotal[E:,kc]  %@Comma[%@Eval[%@DiskTotal[C:,k]+%@DiskTotal[D:,k]+%@DiskTotal[E:,k]]]
Echo %@DiskTotal[C:,mc] %@DiskTotal[D:,mc] %@DiskTotal[E:,mc]  %@Comma[%@Eval[%@DiskTotal[C:,m]+%@DiskTotal[D:,m]+%@DiskTotal[E:,m]]]
 
May 24, 2010
855
0
Northlake, Il
Guys, I found the problem. You see, the function truncates any fractional value so the 321987k becomes 321m and it is the sum of those three what would be fractional megabyte values that goes up to the next megabyte in the kilobyte measurements and those fractional values for megabytes are discarded.
 

Similar threads