[J3] Draft interp on mathematical equivence

Toon Moene toon at moene.org
Sat Aug 10 21:29:35 UTC 2024


On 8/10/24 23:01, Robert Corbett via J3 wrote:

> The question assumes that the rules of mathematical equivalence need to accommodate NaNs and infinites.  That was not the intent of the committee when the concept of mathematical equivalence was added to the standard.  The rules of mathematical equivalence assume that expressions can be modified as if integer, real, and complex expressions are mathematical integer, real, and complex expressions, subject to a few additional restrictions stated in the standard, such as the requirement that the integrity of parentheses be honored.
> 
> Bob Corbett

 From the Fortran 77 Standard (6.6 Evaluation of Expressions):

"Any arithmetic operation whose result is not mathematically defined is
prohibited in the execution of an executable program. Examples are
dividing by zero and raising a zero-valued primary to a zero-valued or 
negative-valued power. Raising a negative-valued primary to a real or
double precision power is also prohibited."

It is my understanding that the concept of NaN or Infinity is only 
catered for when USEing the IEEE modules:

"17.1 Overview of IEEE arithmetic support

The intrinsic modules IEEE_EXCEPTIONS, IEEE_ARITHMETIC, and
IEEE_FEATURES provide support3 for the facilities defined by ISO/IEC 
60559:2020."

(From the latest version - 2023 - of the Standard).

Kind regards,

-- 
Toon Moene - e-mail: toon at moene.org - phone: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands



More information about the J3 mailing list