realbasic-nug
[Top] [All Lists]

Re: FolderItem.Length Feature Request

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: FolderItem.Length Feature Request
From: Norman Palardy <npalardy at great-white-software dot com>
Date: Thu, 30 Jun 2005 13:54:59 -0600
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <47121EA3-985C-4469-94B3-E78A734698C6 at texastowers dot com> <add5d81527a77fb19f165de10bc7c234 at great-white-software dot com> <bcda79c776a3e02bbaef685ba3e542c6 at frontiernet dot net>

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>

<Prev in Thread] Current Thread [Next in Thread>