matherr man page on Cygwin

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

MATHERR(3)			    NEWLIB			    MATHERR(3)

NAME
       1.40 `matherr'--modifiable math error handler

SYNOPSIS
	    #include <math.h>
	    int matherr(struct exception *E);

DESCRIPTION
       `matherr'  is  called  whenever	a  math	 library function generates an
       error.  You can replace `matherr' by your own subroutine	 to  customize
       error treatment.	 The customized `matherr' must return 0 if it fails to
       resolve the error, and non-zero if the error is resolved.

	  When `matherr' returns a nonzero value, no error message is  printed
       and the value of `errno' is not modified.  You can accomplish either or
       both of these things in your own `matherr' using the information passed
       in the structure `*E'.

	  This is the `exception' structure (defined in ``math.h''):
		 struct exception {
			 int type;
			 char *name;
			 double arg1, arg2, retval;
		      int err;
		 };

	  The  members of the exception structure have the following meanings:
       `type'
	    The type of mathematical error that occured; macros encoding error
	    types are also defined in ``math.h''.

       `name'
	    a pointer to a null-terminated string holding the name of the math
	    library function where the error occurred.

       `arg1, arg2'
	    The arguments which caused the error.

       `retval'
	    The error return value (what the calling function will return).

       `err'
	    If set to be non-zero, this is the new value assigned to `errno'.

	  The error types defined in ``math.h'' represent possible  mathemati‐
       cal errors as follows:

       `DOMAIN'
	    An argument was not in the domain of the function; e.g.
	    `log(-1.0)'.

       `SING'
	    The requested calculation would result in a singularity; e.g.
	    `pow(0.0,-2.0)'

       `OVERFLOW'
	    A calculation would produce a result too large to represent; e.g.
	    `exp(1000.0)'.

       `UNDERFLOW'
	    A calculation would produce a result too small to represent; e.g.
	    `exp(-1000.0)'.

       `TLOSS'
	    Total loss of precision.  The result would have no significant
	    digits; e.g. `sin(10e70)'.

       `PLOSS'
	    Partial loss of precision.

RETURNS
       The library definition for `matherr' returns `0' in all cases.

	  You  can  change  the	 calling  function's  result from a customized
       `matherr' by modifying `e->retval', which propagates backs to the call‐
       er.

	  If `matherr' returns `0' (indicating that it was not able to resolve
       the error) the caller sets `errno' to an appropriate value, and	prints
       an error message.

PORTABILITY
       `matherr' is not ANSI C.

SEE ALSO
       matherr	is  part  of the library.  The full documentation for is main‐
       tained as a Texinfo manual.  If info and are properly installed at your
       site, the command

	      info

       will give you access to the complete manual.

NEWLIB				  April 2010			    MATHERR(3)
[top]

List of man pages available for Cygwin

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