ieee_environment man page on OpenIndiana

Man page or keyword search:  
man Server   20441 pages
apropos Keyword Search (all sections)
Output format
OpenIndiana logo
[printable version]

IEEE_ENVIRONMENT(3F)					  IEEE_ENVIRONMENT(3F)

NAME
       ieee_environment	 -  mode,  status, and signal handling for IEEE arith‐
       metic

SYNOPSIS
	#include "floatingpoint.h"

       integer*4 function ieee_flags(action,mode,in,out)
       character*(*) action, mode, in, out

       integer*4 function ieee_handler(action,exception,hdl)
       character*(*) action, exception
       sigfpe_handler_type hdl

       sigfpe_handler_type function sigfpe(code, hdl)
       sigfpe_code_type code
       sigfpe_handler_type hdl

DESCRIPTION
       These subprograms provide modes and status required  to	fully  exploit
       ANSI/IEEE Standard 754-1985 arithmetic in a FORTRAN program.  They cor‐
       respond closely to the functions ieee_flags(3M), ieee_handler(3M),  and
       sigfpe(3).

USAGE
       Example	1:  Set	 rounding  direction  to round toward zero, unless the
       hardware does not support directed rounding modes:

	    integer*4 ieeer
	    character*1 mode, out, in
	    ieeer = ieee_flags('set', 'direction', 'tozero', out)

       Example 2: Clear rounding direction to default, round toward nearest:

	    character*1 out, in
	    ieeer = ieee_flags('clear','direction', in, out)

       Example 3: Clear all accrued exception-occurred bits:

	    character*16 out
	    ieeer = ieee_flags('clear','exception','all',out)

       Example 4: If example 3 generates the overflow  exception,  detect  the
       exception as follows:

	    character*16 out
	    ieeer = ieee_flags('get','exception','overflow', out)
       Example	5: A user-specified signal handler, with a main program to use
       it:

	    external hand
	    real r / 14.2 /,  s / 0.0 /
	    i = ieee_handler( 'set', 'division', hand )
	    t = r/s
	    end

	    integer function hand ( sig, sip, uap )
	    integer sig, address
	    structure /fault/
		 integer address
	    end structure

	    structure /siginfo/
		 integer si_signo
		 integer si_code
		 integer si_errno
		 record /fault/ fault
	    end structure

	    record /siginfo/ sip

	    address = sip.fault.address
	    write (*,10) address
	10  format('Exception at hex address ', z8 )
	    end

SEE ALSO
       floatingpoint(3F), signal(3C), sigfpe(3C),  ieee_handler(3M),  and  the
       Numerical Computation Guide

				  2008/04/24		  IEEE_ENVIRONMENT(3F)
[top]

List of man pages available for OpenIndiana

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net