From: tkoenig@netcologne.de   
      
   Michael S schrieb:   
   > On Sat, 13 Sep 2025 14:55:58 -0000 (UTC)   
   > Thomas Koenig wrote:   
   >   
   >> Similarly, rounding modes are saved and restored for procedures.   
   >   
   > I am not sure that I understand.   
   > 1. Is Fortran's equivalent of C's fesetround() is considered a   
   > languge primitive rather than procedure?   
      
   Fortran has intrinsic procedures (like SIN, MATMUL or CPU_TIME),   
   procedures from intrinsic modules, like COMPILER_OPTIONS   
   from ISO_FORTRAN_ENV, and user-defined procedures.   
   IEEE_SET_ROUNDING_MODE is a procedure from an intrinsic module   
   (but an optional one). It need not be an external function;   
   the compiler is free to do other things to implement it.   
      
   (Hope this answers your question)   
      
   > 2. Does above said mean that caller has no way of modifying rounding   
   > mode used by callee? If true, it defeats one of original reasons for   
   > which Kahan invented rounding modes in the first place.   
      
   The caller cannot change the callee's rounding mode without the   
   callee having been designed for this (by taking the rounding mode   
   as an extra argument and using IEEE_SET_ROUNDING_MODE itself).   
      
   I think that's a good idea. If a library routine is written   
   and debugged for a particular rounding mode, results should   
   not change because somebody up the call tree changed it.   
   --   
   This USENET posting was made without artificial intelligence,   
   artificial impertinence, artificial arrogance, artificial stupidity,   
   artificial flavorings or artificial colorants.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|