[J3] Generic interface for IEEE_SELECTED_REAL_KIND?

Bill Long longb at cray.com
Thu Jan 3 10:45:06 EST 2019


Regarding the possibility of writing intrinsic module procedures directly in Fortran, 

> On Jan 2, 2019, at 8:18 PM, Malcolm Cohen via J3 <j3 at mailman.j3-fortran.org> wrote:
> 
>  Just wait ‘til you see the rest of the intrinsic module procedures! 

Indeed. In IEEE_ARITHMETIC alone, consider the routines to get/set the rounding mode. You could imagine a Fortran implementation that just calls what looks (interface-wise) to be a C function that is  actually a block of hand-written, hardware-specific assembly code that manipulates the hardware’s rounding settings.   I don’t think that most people would consider this as being “written in Fortran”.  It’s just a scheme for deferring the magic to a different place.    The case for ieee_selected_real_kind is slightly different in that the place to which you are deferring the magic (selected_real_kind) is actually already part of Fortran, so the compiler already knows what to do. 

Cheers,
Bill


Bill Long                                                                       longb at cray.com
Principal Engineer, Fortran Technical Support &   voice:  651-605-9024
Bioinformatics Software Development                      fax:  651-605-9143
Cray Inc./ 2131 Lindau Lane/  Suite 1000/  Bloomington, MN  55425




More information about the J3 mailing list