how *not* to use denormalised numbers?

Steve Kargl sgk@troutmask.apl.washington.edu
Tue Nov 10 15:16:00 GMT 2015


On Tue, Nov 10, 2015 at 06:41:48AM -0800, Anton Shterenlikht wrote:
> Are denormalised numbers supported by default by gfortran6 (or 5)?
> My understanding was that the use has to request
> the use of denormalised numbers explicitly, via USE statement,
> e.g. MFE, p.225.
> 
> I have a program that does *not* USE ieee_features,
> compiled by gfortran6 with these flags:
> 
> -fopenmp -fbacktrace -Wall
> 
> It returns (FreeBSD amd64):
> 
> Note: The following floating-point exceptions are signalling: IEEE_UNDERFLOW_FLAG IEEE_DENORMAL
> 
> suggesting denormalised numbers were used.
> 
> I don't want to use denormalised numbers.
> A flash to zero is acceptable, provided
> this will trigger underflow exception.
> What gfortran option(s) will achieve this?
> 

Although I haven't checked, you'll probably need to use the
IEEE arithmetic modules to control subnormal numbers or use
C interop and fenv features to manipulate the FPU.

-- 
Steve



More information about the Fortran mailing list