Boost logo

Boost Users :

From: Rush Manbert (rush_at_[hidden])
Date: 2005-09-13 12:14:10


Beman Dawes wrote:

>"Sohail Somani" <s.somani_at_[hidden]> wrote in message
>news:1C1EBEF8DBACDC439D038EA051674EC709C600_at_xbox.financialcad.com...
>
>
>>>-----Original Message-----
>>>From: boost-users-bounces_at_[hidden]
>>>[mailto:boost-users-bounces_at_[hidden]] On Behalf Of me22
>>>Sent: Monday, September 12, 2005 4:36 PM
>>>To: boost-users_at_[hidden]
>>>Subject: Re: [Boost-users] [BULK] Re: [BULK] [filesystem]
>>>function todetermineavailable space
>>>
>>>
>>>On 12/09/05, Sohail Somani <s.somani_at_[hidden]> wrote:
>>>
>>>
>>>>What about using a type that guarantees a certain amount instead of
>>>>just "max" (which may vary)? Or equivalently, are we
>>>>
>>>>
>>>guaranteed that
>>>
>>>
>>>>uintmax_t can hold, say one TB, on any platform that boost supports?
>>>>
>>>>
>>>>
>>>Even 1 TB isn't really safe. I know a number of people with
>>>more total storage than that.
>>>
>>>How about a double? The imprecision shouldn't be a worry --
>>>if you're beyond the range of a double's precision for free
>>>space then being off by even a few MB it doesn't matter and
>>>doubles are perfectly precise for small integral numbers. (
>>>on x86 linux it seems my 64-bit doubles have 53 bits of
>>>mantissa meaning they're perfectly precise for anything less
>>>than 8192 TeraBytes. I don't know what the standard specifes
>>>though, and my 32-bit floats are only perfectly precise for
>>>under 16 MB. That being said, even the 32-bit float has a
>>>max of over 3e26 TB, so just saying the precision of the
>>>number returned is dependant on the precision of your
>>>platform's double would get around that, assuming of course
>>>we can assure that any rounding is done on the safe side. )
>>>
>>>Also, the implementation could work internally in whatever it
>>>wants to keep perfect precision and just feed out a double at the end.
>>>
>>>
>>Great idea. I'm ok with this. What about platforms like linux or
>>windows? What types do they use to report these stats?
>>
>>
>
>64-bit integers. Every C++ compiler Boost tests run on, even really old ones
>like VC++ 6.0 and GCC2.95, have a 64-bit integral type. Mostly long long,
>but sometimes long or _int64. The C and C++ standards committees are in
>process of standardizing long long.
>
>

Please forgive me for sticking my nose in here, but I believe the SCSI standard provides for data access instructions that contain 48 bit block addresses. Each block is 512 bytes for open systems, which is 9 bits, so you need 57 bits to give a byte count for a single logical device. 64 bit integers are the way to go.

- Rush


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net