Windows file size calculation?
Posted: 27 Aug 2023, 11:38
During my AHK project, I noticed something that I do not understand about the way Windows (7) calculates/reports the file size within the Properties dialog.
Can anyone tell me why the OS has reported 19.8mb rather than 19.9mb for FileSize?
I understand that the value is "floored" at the first decimal point, rather than rounded. But even with this, this should still report 19.9mb, rather than 19.8mb.
20,867,069 / (1024*1024) = 19.900387764
My calculations within my project don't match what Windows reports (regarding abbreviated size). In my investigation for a reason, I found that Windows requires another 409 bytes to report 19.9, and I can't figure out why?
Obviously this is not a critical issue since I use actual bytes for my calculations, which does match Windows exactly. I was just curious as to why there is a difference, and if anyone may be able to provide insight regarding the inner workings of the OS formula being used to abbreviate the size.
Thanks! Andy
Can anyone tell me why the OS has reported 19.8mb rather than 19.9mb for FileSize?
I understand that the value is "floored" at the first decimal point, rather than rounded. But even with this, this should still report 19.9mb, rather than 19.8mb.
20,867,069 / (1024*1024) = 19.900387764
My calculations within my project don't match what Windows reports (regarding abbreviated size). In my investigation for a reason, I found that Windows requires another 409 bytes to report 19.9, and I can't figure out why?
Obviously this is not a critical issue since I use actual bytes for my calculations, which does match Windows exactly. I was just curious as to why there is a difference, and if anyone may be able to provide insight regarding the inner workings of the OS formula being used to abbreviate the size.
Thanks! Andy