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



Scott Klement wrote:
> Okay, that makes sense... but, then why did it work in V5R1?  And V4R5?
> Why does it use 8F if all of the operands are 30p?
> Is it documented somewhere than exponentiation always outputs float, no
> matter what your operands are?
> 

Others have pointed out the section in the docs that describe the output of 
the ** operator. 

Why use 8F format if all operands are 30P? As you know, exponentiation can 
yield some pretty large values, and double precision float was selected as 
a format that can handle those possible values. On the other hand, we now 
have (in V5R3) a decimal format that can handle values up to 63 digits. And 
so perhaps it might now be appropriate to add a "decimal power" built-in 
function. (I'll add it to our wish list when I get back in the office.)

What changed between releases? Why worry about it at all? The difference is 
in the part of the value past the 17 digit. Anything past that point cannot 
be trusted with double precision IEEE float format. Ever. That is, as far 
as IEEE float is concerned, if two numbers differ starting at the 18th 
digit, they pretty much represent the same number. The only possible 
difference is that perhaps the algorithm used to format the number in 
readable form has changed. The arithmetic involved almost certainly did not 
change. (You could verify that by looking at the float values in hex.)

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. ;-)

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.