On Jun 30, 2005, at 1:37 PM, Harrie Westphal wrote:
Norman,
Are you sure about this? You will be working with whole numbers, no
fractional parts, so why would a double be wrong as long as your file
size does not exceed 16 digits, about 10,000 terabytes. As long as I
have been programming the only problems I have ever seen with
floatiing point calculations is when numbers are not whole numbers.
But, this is my experience on IBM mainframes, but still, floating
point, double/single, is floating point.
Just curious why you say this in case I am missing something.
Some other private emails have asked the same thing.
And, you're right, that as long as you use it this way you will
probably never exceed the mantissa and are likely to remain using
essentially an integer value.
But, using the current size (in my example i) in a calculation with
other values, etc is going to result in floating point arithmetic and
thereby some kind of cumulative error because of the range that can be
represented.
A long integer would avoid any such calculation errors long term.
For instance if you wanted to process the file 10% at a time and did
something like :
dim fileSize as double
dim i as double
fileSize = f.length
for i = 1 to 10
f.position = fileSize * .10
somebytes = f.read(fileSize * .10)
next
I suspect there would be issues with accuracy in positioning in the
BinaryStream.
A 64 bit integer would be useful to this and several other items.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|