James G. Sack (jim) wrote:
boblq wrote:
On Thursday 08 June 2006 01:30 pm, Andrew Lentvorski wrote:
Unfortunately, the same experience doesn't exist for decimal floating
point. However, I can tell you that I have yet to meet even a good
programmer who can write binary floating point code that doesn't have
all manner of horrible problems.
-a
I will go along with that. Back in the early 80's I was
developing an application for the Apple II. We had
data that had a wide dynamic range and low accuracy.
We had lots of it and so I thought well just make up
a special floatingpoint for this data and cram it all
into 8 bits IIRR. It worked. But it was not nearly as easy
as I thought it would be. We did it with binary floating
point. I suspect it would have made more sense to
invent some kind of decimal floatingpoint, but we were
ignorant of all of the issues involved when we started ...
as is often the case.
So, I wonder:
-what's the current state of the decimal floating point movement
-and what's the prognosis for general availability & adoption?
Not sure what the current state is but I have suddenly found myself
having to implement BCD arithmetic. In an effort to replace some
proprietary code I have to independently come up with a way to do
functions with up to 64 digits of precision, with the BCD numbers being
packed into a byte array of two digits per byte and the array being 32
bytes.
So far I've done the add, subtract, and multiply. The divide part is
going to give me a headache. This is probably something from CS101 which
I never took :/ since I jumped into programming more as assembling
someone else's components and therefore didn't learn all the bad habits
of low level programming.
I'm sure this has been done thousands of times but the license issue is
the actual sticking point. I need to be able to license it under the
LGPL. The project itself it to replace the FMTBcd unit of Borland
Delphi/Kylix so that other third party components will work in FreePascal.
Gus
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg