× 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.



| -----Original Message-----
| [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Hans Boldt
| Sent: Friday, February 20, 2004 11:02 AM
| Subject: Re: Strange result with exponents...

| jt wrote:
| > ...
| > | As a rough guideline, I'd simply recommend avoiding float
| numeric values
| > | unless you know what you're doing. Perhaps a B (or better) grade
| > | in senior
| > | high school physics would be a good pre-req. ;-)
| >
| > Hans, I got an A in HS physics and read graduate level
| textbooks to do my
| > final paper.  I'm NOT stupid, but I'm guessing you know me well
| enough to
| > know I do (and say) some of THE most outrageously STUPID things, anyway.
| > (If I knew why I did some stupid things, I wouldn't...;-)  ANYhoo...
|
| For me, I got a 90% in my final HS physics class, good enough for best
| in the class. For some reason, I felt it necessary to take the tough
| physics course in 1st year university, and I consider myself very lucky
| to have passed that course with a 57%! Some of my friends in that class
| weren't so fortunate.
|
| My point is just that float format was primarily intended for scientific
| calculations, and an understanding of the concept of precision is
| important.
|
| Here's another practical example. Let's say you have two 16 digit float
| values that differ only in the 16th digit. What is the precision of the
| result of subtracting the two values? 16 digits? No. The following
| Python command line session illustrates:
|
|  >>> a=1.111111111111111
|  >>> b=1.111111111111112
|  >>> b-a
| 1.1102230246251565e-015
|
| Although IEEE format represents a value with 17 digits, only the first
| is significant.
|
| OK sure, that's an extreme example, but I think it's important to
| understand the issues involved. And as RPG acquires more and more
| enhancements, it becomes more and more important to understand these
| fundamental issues.
|
| > ...
|
| Anyways, I just recorded a suggestion in our "Suggestions for Future
| Enhancements" file for a decimal exponentiation operator. It certainly
| wouldn't be as fast as the current ** operator, but it would provide
| more digits. (Speed or accuracy - make your choice!)
|
| Cheers! Hans

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.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.