× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



jt wrote:
Cheers, Hans...  I couldn't figure out why anyone would WANT to use FP,
until you mentioned speed.

But I can't possibly disagree More with this statement: "My point is just
that float format was primarily intended for scientific calculations, and an
understanding of the concept of precision is important."  It's important to
You, because you write Turing machines (compilers).

And FP (afaik) IS covered in even 2-year programs and so yes, I agree,
programmers Should be familiar.  HOWEVER, you have almost no understanding
of what it is to do biz programming, as you've mentioned before.  And if you
think biz programmers Should be as familiar as you are with FP, then you are
mistaken.  When I do arithmetic I want a correct result, not an estimate via
FP.  Because the arithmetic is only a small SUBSET of the issues I hafta
deal with in writing a biz app.

I should add, in my experience anyway...  But I'd be surprised if there were
a whole LOTta people who disagree with this aspect of the problem.


A couple of points:


1) With respect to business programming, when you do arithmetic on monetary values, you want to, no, you NEED to follow the rules and regulations governing monetary computations in your jurisdiction. That may or may not require "exact" results. For example, as I understand it, the EU requires Euro computations to be exact to the whole Euro cent, with a certain style of rounding. That is, no fractional cents. Other jurisdictions may have different rules. And in cases where the jurisdiction does not lay down precise rules, companies may have specific accounting policies you have to follow.

My point here is that "correct result" is often largely a matter of accounting policy, and it's the job of the application programmer to match the capabilities of the chosen tool with the rules. As you've said, compiler writers are not generally well versed in accounting practice. ;-)

2) As I've said before, IEEE float will not give you an exact result anyways, so of course it should be avoided for monetary calculations.

3) "Infinite precision" integer operations are certainly available in some languages, like Python. But you might not like the performance of such interpreted languages compared to compiled languages like RPG. ;-)

Cheers! Hans


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.