(j3.2006) (SC22WG5.5299) [ukfortran] Did we intend to prohibit this?
Bill Long
longb
Thu Jul 3 18:47:54 EDT 2014
On Jul 3, 2014, at 12:56 PM, Van Snyder <van.snyder at jpl.nasa.gov> wrote:
> On Thu, 2014-07-03 at 11:14 +0100, N.M. Maclaren wrote:
>> On Jul 3 2014, Van Snyder wrote:
>>
>>> As far as I can tell from looking at 7.1.12, the only function from
>>> IEEE_Arithmetic that's allowed in a constant expression is
>>> IEEE_Selected_Real_Kind.
>>>
>>> Did we intend to prohibit all the others?
>>>
>>> Is there a problem with admitting the inquiry functions, and admitting
>>> the others provided their arguments are constant expressions?
>>
>> One issue that would have to be considered is what requirements we would
>> place on compile- and run-time options to control the modes. IEEE 754
>> remains a very assembler-level specification, does not map well even
>> to C, and its arithmetic model is seriously incompatible with Fortran's.
>> This is probably resolvable, but isn't just a matter of relaxing the
>> restrictions. I, for one, lack the enthusiasm to tackle this.
>
> The reason this question arose was an attempt at the following:
>
> integer, parameter :: RK = kind(1.0e0)
> real(rk), parameter :: SNaN = merge( IEEE_Value(1.0_rk,IEEE_Signaling_NaN), &
> & 0.0_rk, IEEE_Support_DataType(1.0_rk) )
>
> Are there at least a few functions from IEEE_Arithmetic, and the two
> inquiry functions from IEEE_Exceptions, that we could admit into
> constant expressions? The functions that don't depend upon modes,
> especially the inquiry functions, ought not to be troublesome.
Note that the edits in interp F08/0104 do expand the list:
[152:7-8] section 7.1.12 Constant expression, paragraph 1, replace
bullet (8):
"(8) a reference to the transformational function
IEEE_SELECTED_REAL_KIND from the intrinsic module
IEEE ARITHMETIC (14), where each argument is a constant
expression,"
with:
"(8) a reference to a transformational function from the
intrinsic module IEEE_ARITHMETIC or IEEE_EXCEPTIONS (14), where
each argument is a constant expression,?
Some of the former Inquiry functions were reclassified as transformational by this interp, though apparently not the ones you need above. Perhaps you could propose expanding the list. I don?t see a technical reason why the code you proposed could not work.
Cheers,
Bill
>
> While looking at this, I noticed that IEEE_Is_Finite appears twice in
> Table 14.1. Is there a reason for this, or is it just a typo?
>
>> Regards,
>> Nick.
>>
>
>
> _______________________________________________
> J3 mailing list
> J3 at mailman.j3-fortran.org
> http://mailman.j3-fortran.org/mailman/listinfo/j3
Bill Long longb at cray.com
Fortran Technical Suport & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9142
Cray Inc./ Cray Plaza, Suite 210/ 380 Jackson St./ St. Paul, MN 55101
More information about the J3
mailing list