IceWalkers.com - Linux Software downloads and news
Name : Password :
Linux SoftwareLinux RPMLinux HowtosLink UsAboutAdvertise

feclearexcept (3)

FENV(3)                    Linux Programmer's Manual                   FENV(3)



NAME
       feclearexcept,  fegetexceptflag, feraiseexcept, fesetexceptflag, fetes-
       texcept,  fegetenv,  fegetround,  feholdexcept,  fesetround,  fesetenv,
       feupdateenv - C99 floating point rounding and exception handling

SYNOPSIS
       #include<fenv.h>

       voidfeclearexcept(int excepts);
       voidfegetexceptflag(fexcept_t*flagp,int excepts);
       voidferaiseexcept(int excepts);
       voidfesetexceptflag(constfexcept_t*flagp,int excepts);
       intfetestexcept(int excepts);

       intfegetround(void);
       intfesetround(int rounding_mode);

       voidfegetenv(fenv_t*envp);
       intfeholdexcept(fenv_t*envp);
       voidfesetenv(constfenv_t*envp);
       voidfeupdateenv(constfenv_t*envp);

DESCRIPTION
       These  eleven  functions were defined in C99, and describe the handling
       of floating point rounding and exceptions (overflow, zero-divide etc.).

   Exceptions
       The  DivideByZero  exception occurs when an operation on finite numbers
       produces infinity as exact answer.

       The Overflow exception occurs when a result has to be represented as  a
       floating  point  number,  but has (much) larger absolute value than the
       largest (finite) floating point number that is representable.

       The Underflow exception occurs when a result has to be represented as a
       floating point number, but has smaller absolute value than the smallest
       positive normalized floating point number (and would lose much accuracy
       when represented as a denormalized number).

       The Inexact exception occurs when the rounded result of an operation is
       not equal to the infinite precision  result.   It  may  occur  whenever
       Overflow or Underflow occurs.

       The  Invalid  exception occurs when there is no well-defined result for
       an operation, as for 0/0 or infinity - infinity or sqrt(-1).

   Exceptionhandling
       Exceptions are represented in two ways:  as  a  single  bit  (exception
       present/absent),  and  these  bits  correspond  in some implementation-
       defined way with bit positions in an integer, and  also  as  an  opaque
       structure  that  may contain more information about the exception (per-
       haps the code address where it occurred).

       Each of the macros FE_DIVBYZERO, FE_INEXACT,  FE_INVALID,  FE_OVERFLOW,
       FE_UNDERFLOW  is  defined  when the implementation supports handling of
       the corresponding exception, and if so then defines  the  corresponding
       bit(s),  so  that  one can call exception handling functions e.g. using
       the integer argument FE_OVERFLOW|FE_UNDERFLOW.  Other exceptions may be
       supported. The macro FE_ALL_EXCEPT is the bitwise OR of all bits corre-
       sponding to supported exceptions.

       The feclearexcept function clears the supported exceptions  represented
       by the bits in its argument.

       The  fegetexceptflag  function  stores a representation of the state of
       the exception flags represented by the argument excepts in  the  opaque
       object *flagp.

       The  feraiseexcept function raises the supported exceptions represented
       by the bits in excepts.

       The fesetexceptflag function sets the complete status  for  the  excep-
       tions represented by excepts to the value *flagp.  This value must have
       been obtained by an earlier call of fegetexceptflag with a  last  argu-
       ment that contained all bits in excepts.

       The fetestexcept function returns a word in which the bits are set that
       were set in the argument excepts and for which the corresponding excep-
       tion is currently set.

   Rounding
       Each  of the macros FE_DOWNWARD, FE_TONEAREST, FE_TOWARDZERO, FE_UPWARD
       is defined when the implementation supports  getting  and  setting  the
       corresponding rounding direction.

       The  fegetround function returns the macro corresponding to the current
       rounding mode.

       The fesetround function sets the rounding  mode  as  specified  by  its
       argument and returns zero when it was successful.

   Floatingpointenvironment
       The entire floating point environment, including control modes and sta-
       tus flags, can be handled as one opaque object, of  type  fenv_t.   The
       default  environment is denoted by FE_DFL_ENV (of type const fenv_t *).
       This is the environment setup at program start and it is defined by ISO
       C to have round to nearest, all exceptions cleared and a non-stop (con-
       tinue on exceptions) mode.

       The fegetenv function saves the current floating point  environment  in
       the object *envp.

       The  feholdexcept  function  does  the  same, then clears all exception
       flags, and sets a non-stop (continue on exceptions) mode, if available.
       It returns zero when successful.

       The  fesetenv function restores the floating point environment from the
       object *envp.  This object must be known to be valid, e.g., the  result
       of  a  call  to  fegetenv or feholdexcept or equal to FE_DFL_ENV.  This
       call does not raise exceptions.

       The feupdateenv function installs the floating-point environment repre-
       sented by the object *envp, except that currently raised exceptions are
       not cleared.  After calling this function, the raised  exceptions  will
       be  a  bitwise  OR  of  those  previously  set with those in *envp.  As
       before, the object *envp must be known to be valid.


GNUDETAILS
       If possible, the GNU C Library defines a macro FE_NOMASK_ENV which rep-
       resents  an  environment  where every exception raised causes a trap to
       occur.  You can test for this macro using #ifdef.  It is  only  defined
       if  _GNU_SOURCE  is defined.  The C99 standard does not define a way to
       set individual bits in the floating point mask, e.g. to  trap  on  spe-
       cific  flags.   glibc 2.2 will support the functions feenableexcept and
       fedisableexcept to set individual floating point traps, and fegetexcept
       to query the state.

       intfeenableexcept(int excepts);
       intfedisableexcept(int excepts);
       intfegetexcept(void);

       The feenableexcept and fedisableexcept functions enable (disable) traps
       for each of the exceptions represented by excepts and return the previ-
       ous  set  of enabled exceptions when successful, and -1 otherwise.  The
       fegetexcept function returns the set of all  currently  enabled  excep-
       tions.


CONFORMINGTO
       IEC 60559 (IEC 559:1989), ANSI/IEEE 854, ISO C99 (ISO/IEC 9899:1999).



Linux Manpage                     2000-08-12                           FENV(3)

CMSG_ALIGNfmodllroundfstrncmp
CMSG_FIRSTHDRfnmatchllroundlstrncpy
CMSG_NXTHDRfopenlocaleconvstrndup
CMSG_SPACEforkptylocaltimestrndupa
MB_CUR_MAXfpathconflockfstrnlen
MB_LEN_MAXfprintflogstrpbrk
__fbufsizefpurgelog10strptime
__flbffputclog1pstrrchr
__fpendingfputc_unlockedlogin_ttystrsep
__fpurgefputslogwtmpstrsignal
__freadablefputs_unlockedlongjmpstrspn
__freadingfputwclrand48strstr
__fsetlockingfputwc_unlockedlrintstrtod
__fwritablefputwslrintfstrtof
__fwritingfputws_unlockedlrintlstrtok
__malloc_hookfreadlroundstrtok_r
__setfpucwfread_unlockedlroundfstrtol
_flushlbffreelroundlstrtold
a64lfreeaddrinfolsearchstrtoll
abortfreehostentmakecontextstrtoq
absfreopenmallocstrtoul
acosfrexpmalloc_hookstrtoull
acoshfscanfmblenstrtouq
addmntentfseekmbrlenstrverscmp
allocafseekombrtowcstrxfrm
alphasortfsetposmbsinitsvc_destroy
argz_addftellmbsnrtowcssvc_freeargs
argz_add_sepftellombsrtowcssvc_getargs
argz_appendftimembstowcssvc_getcaller
argz_countftokmbtowcsvc_getreq
argz_createftrylockfilememalignsvc_getreqset
argz_create_sepftsmemccpysvc_register
argz_deletefts_childrenmemchrsvc_run
argz_extractfts_closememcmpsvc_sendreply
argz_insertfts_openmemcpysvc_unregister
argz_nextfts_readmemfrobsvcerr_auth
argz_replacefts_setmemmemsvcerr_decode
argz_stringifyftwmemmovesvcerr_noproc
asctimefunlockfilememrchrsvcerr_noprog
asinfwidememsetsvcerr_progvers
asinhfwprintfmkdtempsvcerr_systemerr
asprintffwritemkfifosvcerr_weakauth
assertfwrite_unlockedmkstempsvcfd_create
assert_perrorgai_strerrormktempsvcraw_create
atangammamktimesvctcp_create
atan2gammafmodfsvcudp_bufcreate
atanhgammalmpoolsvcudp_create
atexitgcvtmrand48swab
atofget_current_dir_namemtraceswapcontext
atoiget_myaddressmuntraceswprintf
atolgetaddrinfonansysconf
atollgetcnanfsyslog
atoqgetc_unlockednanlsystem
auth_destroygetcharnearbyinttan
authnone_creategetchar_unlockednearbyintftanh
authunix_creategetcwdnearbyintltcdrain
authunix_create_defaultgetdatenetlinktcflow
basenamegetdate_rnextaftertcflush
bcmpgetdelimnextafterftcgetattr
bcopygetdirentriesnextafterltcgetpgrp
bindresvportgetenvnexttowardtcgetsid
bsearchgetfsentnexttowardftcsendbreak
bstringgetfsfilenexttowardltcsetattr
btowcgetfsspecnftwtcsetpgrp
btreegetgrentnl_langinfotdelete
byteordergetgrgidnrand48telldir
bzerogetgrnamntohltempnam
callocgethostbyaddrntohstermios
callrpcgethostbynameon_exittfind
catclosegethostbyname2opendirtgamma
catgetsgethostbyname2_ropenlogtgammaf
catopengethostbyname_ropenptytgammal
cbrtgetipnodebyaddrpathconftimegm
ceilgetipnodebynamepclosetimelocal
ceilfgetlineperrortmpfile
ceillgetloadavgpmap_getmapstmpnam
cfgetispeedgetloginpmap_getporttoascii
cfgetospeedgetmntentpmap_rmtcalltolower
cfmakerawgetnameinfopmap_settoupper
cfsetispeedgetnetbyaddrpmap_unsettowctrans
cfsetospeedgetnetbynamepopentowlower
clearenvgetnetentposix_memaligntowupper
clearerrgetoptpowtrunc
clearerr_unlockedgetopt_longprintftruncf
clnt_broadcastgetopt_long_onlyprofiltruncl
clnt_callgetpasspsignaltsearch
clnt_controlgetprotobynameptsnamettyname
clnt_creategetprotobynumberputcttyname_r
clnt_destroygetprotoentputc_unlockedttyslot
clnt_freeresgetptputchartwalk
clnt_geterrgetpwputchar_unlockedtzset
clnt_pcreateerrorgetpwentputenvulimit
clnt_perrnogetpwnamputpwentundocumented
clnt_perrorgetpwuidputsungetc
clnt_spcreateerrorgetrpcbynamepututlineungetwc
clnt_sperrnogetrpcbynumberpututxlineunlocked_stdio
clnt_sperrorgetrpcentputwunlockpt
clntraw_creategetrpcportputwcunsetenv
clnttcp_creategetsputwc_unlockedupdwtmp
clntudp_bufcreategetservbynameputwcharusleep
clntudp_creategetservbyportputwchar_unlockedutmpname
clockgetserventqecvtva_arg
closedirgetttyentqecvt_rva_end
closeloggetttynamqfcvtva_start
cmsggetumaskqfcvt_rvalloc
confstrgetusershellqgcvtvasprintf
copysigngetutentqsortvdprintf
copysignfgetutidqueueverr
copysignlgetutlineraiseverrx
cosgetutxentrandversionsort
coshgetutxidrandomvfprintf
cryptgetutxlinercmdvfscanf
ctermidgetwre_compvfwprintf
ctimegetwcre_execvprintf
cuseridgetwc_unlockedreaddirvscanf
daemongetwcharreallocvsnprintf
dbgetwchar_unlockedrealpathvsprintf
dbopengetwdrecnovsscanf
difftimeglobregcompvswprintf
dirfdglobfreeregerrorvsyslog
dirnamegmtimeregexvwarn
divgrantptregexecvwarnx
dlclosegsignalregfreevwprintf
dlerrorhashregisterrpcwarn
dlopenhasmntoptremovewarnx
dlsymhcreateremquewcpcpy
dn_comphcreate_rres_initwcpncpy
dn_expandhdestroyres_mkquerywcrtomb
dprintfhdestroy_rres_querywcscasecmp
drand48herrorres_querydomainwcscat
dremhsearchres_searchwcschr
dysizehsearch_rres_sendwcscmp
ecvthstrerrorresolverwcscpy
ecvt_rhtonlrewindwcscspn
encrypthtonsrewinddirwcsdup
endfsenthypotrindexwcslen
endgrenticonvrintwcsncasecmp
endhostenticonv_closerintfwcsncat
endmntenticonv_openrintlwcsncmp
endnetentimaxabsroundwcsncpy
endprotoentindexroundfwcsnlen
endpwentinetroundlwcsnrtombs
endrpcentinet_addrrpcwcspbrk
endserventinet_atonrresvportwcsrchr
endttyentinet_lnaofrtnetlinkwcsrtombs
endusershellinet_makeaddrruserokwcsspn
endutentinet_netofscandirwcsstr
endutxentinet_networkscanfwcstok
envz_addinet_ntoaseed48wcstombs
envz_entryinet_ntopseekdirwcswidth
envz_getinet_ptonsetbufwctob
envz_mergeinfnansetbufferwctomb
envz_removeinitgroupssetenvwctrans
envz_stripinitstatesetfsentwctype
erand48insquesetgrentwcwidth
erfintrosethostentwmemchr
erfciruseroksetjmpwmemcmp
errisalnumsetkeywmemcpy
errnoisalphasetlinebufwmemmove
errxisasciisetlocalewmemset
ether_atonisattysetlogmaskwprintf
ether_aton_risblanksetmntentxdr
ether_hosttoniscntrlsetnetentxdr_accepted_reply
ether_lineisdigitsetprotoentxdr_array
ether_ntoaisgraphsetpwentxdr_authunix_parms
ether_ntoa_risinfsetrpcentxdr_bool
ether_ntohostislowersetserventxdr_bytes
execisnansetstatexdr_callhdr
execlisprintsetttyentxdr_callmsg
execleispunctsetusershellxdr_char
execlpisspacesetutentxdr_destroy
execvisuppersetutxentxdr_double
execvpiswalnumsetvbufxdr_enum
exitiswalphashm_openxdr_float
expiswblanksigaddsetxdr_free
expm1iswcntrlsigdelsetxdr_getpos
fabsiswctypesigemptysetxdr_inline
fabsfiswdigitsigfillsetxdr_int
fabsliswgraphsiginterruptxdr_long
fcloseiswlowersigismemberxdr_opaque
fclosealliswprintsiglongjmpxdr_opaque_auth
fcvtiswpunctsignbitxdr_pmap
fcvt_riswspacesigsetjmpxdr_pmaplist
fdopeniswuppersigsetopsxdr_pointer
feclearexceptiswxdigitsinxdr_reference
fegetenvisxdigitsinhxdr_rejected_reply
fegetexceptflagj0sleepxdr_replymsg
fegetroundj0fsnprintfxdr_setpos
feholdexceptj0lsprintfxdr_short
fenvj1sqrtxdr_string
feofj1fsrandxdr_u_char
feof_unlockedj1lsrand48xdr_u_int
feraiseexceptjnsrandomxdr_u_long
ferrorjnfsscanfxdr_u_short
ferror_unlockedjnlssignalxdr_union
fesetenvjrand48stdargxdr_vector
fesetexceptflagkey_decryptsessionstderrxdr_void
fesetroundkey_encryptsessionstdinxdr_wrapstring
fetestexceptkey_gendesstdioxdrmem_create
feupdateenvkey_secretkey_is_setstdio_extxdrrec_create
fflushkey_setsecretstdoutxdrrec_endofrecord
fflush_unlockedkillpgstpcpyxdrrec_eof
ffsklogctlstpncpyxdrrec_skiprecord
fgetcl64astrcasecmpxdrstdio_create
fgetc_unlockedlabsstrcatxprt_register
fgetgrentlcong48strchrxprt_unregister
fgetposldexpstrcmpy0
fgetpwentldivstrcolly0f
fgetslfindstrcpyy0l
fgets_unlockedlgammastrcspny1
fgetwclgamma_rstrdupy1f
fgetwc_unlockedlgammafstrdupay1l
fgetwslgammaf_rstrerroryn
fgetws_unlockedlgammalstrerror_rynf
filenolgammal_rstrfmonynl
fileno_unlockedllabsstrfry 
finitelldivstrftime 
flockfilellrintstring 
floorllrintfstrlen 
floorfllrintlstrncasecmp 


Inkscape 0.47
Vector graphic editor for SVG
DeleGate 9.9.6-pre5
Proxy server which runs on multiple platforms
Nano 2.1.99pre2
Emulate Pico while also offering a few enhancements.
My Money 2.0.49
Personal financial software
Linux Kernel 2.6 2.6.32-rc8
Linux Kernel
GCstar 1.5.0
Personal collections manager
ImageMagick 6.5.7.9
ImageMagick image processing studio
BibleTime 2.4
Bible study software for Linux / KDE
Tellico 2.1.1
Collection manager for books, music, videos, and bibliographies
Totem 2.28.4
Movie player for Gnome
Free IT Magazines, White Papers, eBooks, and more !
Oracle Magazine

Contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more.

Vulnerability Management for Dummies

Get all the Facts and See How to Implement a Successful Vulnerability Management Program.

Website Magazine

Has tapped premier talent in the Internet industry for our content and each and every issue will contain practical advice and insights for website owners.

Linux Software Map
Find Linux RPM
Best Rated Linux Software
Most Rated Linux Software
Linux Distributions
Linux Howtos
Quick Survey

Please take our survey and help us improve our website to serve you better.

Thank you.
Linux Software
Linux / IT Resources
Site Resources
Google
Privacy Policy
Contact Us
Submit Software
Advertising info