[J3] Generic interface for IEEE_SELECTED_REAL_KIND?

Malcolm Cohen malcolm at nag-j.co.jp
Wed Jan 2 19:31:32 EST 2019


>IEEE_SELECTED_RERAL_KIND is listed in Table 17.2 as
>a module procedure available the from IEEE_ARITHMETIC
>module. If a Fortran processor has 2 or more INTEGER
>kinds (say, INTEGER(1) and INTEGER(2)), it is impossible
>to write a generic interface for IEEE_SELECTED_REAL_KIND
>that can be contained within the module.
Yes, it is impossible; this is exactly the same as SELECTED_REAL_KIND.
> Is there a J3 paper that discusses this issue?

There is no issue.  Like intrinsic procedures, procedures in intrinsic modules are just “magic”, and it’s up to the compiler to work whatever magic is required behind the scenes to make them work.
A more trivial bit of magic is that references to IEEE_SELECTED_REAL_KIND are permitted in constant expressions, which is impossible for any user module procedure.
>If the template proposal is accepted then this could be written in Fortran
Well, no. That wouldn’t handle passing absent optional arguments to IEEE_SELECTED_REAL_KIND. Again, the compiler magic required to make it work is trivial, viz it is exactly what is already needed for SELECTED_REAL_KIND.
Cheers,
-- 
...........................Malcolm.
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20190103/9f61ce97/attachment.html>


More information about the J3 mailing list