JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
man pages section 3: Extended Library Functions, Volume 2     Oracle Solaris 11 Information Library
search filter icon
search icon

Document Information

Preface

Extended Library Functions, Volume 2

acos(3M)

acosf(3M)

acosh(3M)

acoshf(3M)

acoshl(3M)

acosl(3M)

advance(3GEN)

asin(3M)

asinf(3M)

asinh(3M)

asinhf(3M)

asinhl(3M)

asinl(3M)

atan2(3M)

atan2f(3M)

atan2l(3M)

atan(3M)

atanf(3M)

atanh(3M)

atanhf(3M)

atanhl(3M)

atanl(3M)

bgets(3GEN)

bufsplit(3GEN)

cabs(3M)

cabsf(3M)

cabsl(3M)

cacos(3M)

cacosf(3M)

cacosh(3M)

cacoshf(3M)

cacoshl(3M)

cacosl(3M)

carg(3M)

cargf(3M)

cargl(3M)

casin(3M)

casinf(3M)

casinh(3M)

casinhf(3M)

casinhl(3M)

casinl(3M)

catan(3M)

catanf(3M)

catanh(3M)

catanhf(3M)

catanhl(3M)

catanl(3M)

cbrt(3M)

cbrtf(3M)

cbrtl(3M)

ccos(3M)

ccosf(3M)

ccosh(3M)

ccoshf(3M)

ccoshl(3M)

ccosl(3M)

ceil(3M)

ceilf(3M)

ceill(3M)

cexp(3M)

cexpf(3M)

cexpl(3M)

cimag(3M)

cimagf(3M)

cimagl(3M)

clog(3M)

clogf(3M)

clogl(3M)

compile(3GEN)

conj(3M)

conjf(3M)

conjl(3M)

copylist(3GEN)

copysign(3M)

copysignf(3M)

copysignl(3M)

cos(3M)

cosf(3M)

cosh(3M)

coshf(3M)

coshl(3M)

cosl(3M)

cpow(3M)

cpowf(3M)

cpowl(3M)

cproj(3M)

cprojf(3M)

cprojl(3M)

creal(3M)

crealf(3M)

creall(3M)

csin(3M)

csinf(3M)

csinh(3M)

csinhf(3M)

csinhl(3M)

csinl(3M)

csqrt(3M)

csqrtf(3M)

csqrtl(3M)

ctan(3M)

ctanf(3M)

ctanh(3M)

ctanhf(3M)

ctanhl(3M)

ctanl(3M)

erf(3M)

erfc(3M)

erfcf(3M)

erfcl(3M)

erff(3M)

erfl(3M)

exp2(3M)

exp2f(3M)

exp2l(3M)

exp(3M)

expf(3M)

expl(3M)

expm1(3M)

expm1f(3M)

expm1l(3M)

fabs(3M)

fabsf(3M)

fabsl(3M)

fdim(3M)

fdimf(3M)

fdiml(3M)

feclearexcept(3M)

fegetenv(3M)

fegetexceptflag(3M)

fegetprec(3M)

fegetround(3M)

feholdexcept(3M)

feraiseexcept(3M)

fesetenv(3M)

fesetexceptflag(3M)

fesetprec(3M)

fesetround(3M)

fetestexcept(3M)

feupdateenv(3M)

fex_getexcepthandler(3M)

fex_get_handling(3M)

fex_get_log(3M)

fex_get_log_depth(3M)

fex_log_entry(3M)

fex_merge_flags(3M)

fex_setexcepthandler(3M)

fex_set_handling(3M)

fex_set_log(3M)

fex_set_log_depth(3M)

floor(3M)

floorf(3M)

floorl(3M)

fma(3M)

fmaf(3M)

fmal(3M)

fmax(3M)

fmaxf(3M)

fmaxl(3M)

fmin(3M)

fminf(3M)

fminl(3M)

fmod(3M)

fmodf(3M)

fmodl(3M)

fpclassify(3M)

frexp(3M)

frexpf(3M)

frexpl(3M)

gamma(3M)

gammaf(3M)

gammaf_r(3M)

gammal(3M)

gammal_r(3M)

gamma_r(3M)

gmatch(3GEN)

HBA_CloseAdapter(3HBAAPI)

HBA_FreeLibrary(3HBAAPI)

HBA_GetAdapterAttributes(3HBAAPI)

HBA_GetAdapterName(3HBAAPI)

HBA_GetAdapterPortAttributes(3HBAAPI)

HBA_GetBindingCapability(3HBAAPI)

HBA_GetBindingSupport(3HBAAPI)

HBA_GetDiscoveredPortAttributes(3HBAAPI)

HBA_GetEventBuffer(3HBAAPI)

HBA_GetFC4Statistics(3HBAAPI)

HBA_GetFcpPersistentBinding(3HBAAPI)

HBA_GetFCPStatistics(3HBAAPI)

HBA_GetFcpTargetMapping(3HBAAPI)

HBA_GetFcpTargetMappingV2(3HBAAPI)

HBA_GetNumberOfAdapters(3HBAAPI)

HBA_GetPersistentBindingV2(3HBAAPI)

HBA_GetPortAttributesByWWN(3HBAAPI)

HBA_GetPortStatistics(3HBAAPI)

HBA_GetRNIDMgmtInfo(3HBAAPI)

HBA_GetVendorLibraryAttributes(3HBAAPI)

HBA_GetVersion(3HBAAPI)

HBA_GetWrapperLibraryAttributes(3HBAAPI)

HBA_LoadLibrary(3HBAAPI)

HBA_OpenAdapter(3HBAAPI)

HBA_OpenAdapterByWWN(3HBAAPI)

HBA_RefreshAdapterConfiguration(3HBAAPI)

HBA_RefreshInformation(3HBAAPI)

HBA_RegisterForAdapterAddEvents(3HBAAPI)

HBA_RegisterForAdapterEvents(3HBAAPI)

HBA_RegisterForAdapterPortEvents(3HBAAPI)

HBA_RegisterForAdapterPortStatEvents(3HBAAPI)

HBA_RegisterForLinkEvents(3HBAAPI)

HBA_RegisterForTargetEvents(3HBAAPI)

HBA_RemoveAllPersistentBindings(3HBAAPI)

HBA_RemoveCallback(3HBAAPI)

HBA_RemovePersistentBinding(3HBAAPI)

HBA_ResetStatistics(3HBAAPI)

HBA_ScsiInquiryV2(3HBAAPI)

HBA_ScsiReadCapacityV2(3HBAAPI)

HBA_ScsiReportLUNsV2(3HBAAPI)

HBA_SendCTPassThru(3HBAAPI)

HBA_SendCTPassThruV2(3HBAAPI)

HBA_SendLIRR(3HBAAPI)

HBA_SendReadCapacity(3HBAAPI)

HBA_SendReportLUNs(3HBAAPI)

HBA_SendRLS(3HBAAPI)

HBA_SendRNID(3HBAAPI)

HBA_SendRNIDV2(3HBAAPI)

HBA_SendRPL(3HBAAPI)

HBA_SendRPS(3HBAAPI)

HBA_SendScsiInquiry(3HBAAPI)

HBA_SendSRL(3HBAAPI)

HBA_SetBindingSupport(3HBAAPI)

HBA_SetPersistentBindingV2(3HBAAPI)

HBA_SetRNIDMgmtInfo(3HBAAPI)

hypot(3M)

hypotf(3M)

hypotl(3M)

ilogb(3M)

ilogbf(3M)

ilogbl(3M)

isencrypt(3GEN)

isfinite(3M)

isgreater(3M)

isgreaterequal(3M)

isinf(3M)

isless(3M)

islessequal(3M)

islessgreater(3M)

isnan(3M)

isnormal(3M)

isunordered(3M)

it_config_commit(3ISCSIT)

it_config_free(3ISCSIT)

it_config_load(3ISCSIT)

it_config_setprop(3ISCSIT)

it_ini_create(3ISCSIT)

it_ini_delete(3ISCSIT)

it_ini_free(3ISCSIT)

it_ini_setprop(3ISCSIT)

it_portal_create(3ISCSIT)

it_portal_delete(3ISCSIT)

it_tgt_create(3ISCSIT)

it_tgt_delete(3ISCSIT)

it_tgt_free(3ISCSIT)

it_tgt_setprop(3ISCSIT)

it_tpg_create(3ISCSIT)

it_tpg_delete(3ISCSIT)

it_tpg_free(3ISCSIT)

it_tpgt_create(3ISCSIT)

it_tpgt_delete(3ISCSIT)

it_tpgt_free(3ISCSIT)

j0(3M)

j0f(3M)

j0l(3M)

j1(3M)

j1f(3M)

j1l(3M)

jn(3M)

jnf(3M)

jnl(3M)

kstat(3KSTAT)

kstat_chain_update(3KSTAT)

kstat_close(3KSTAT)

kstat_data_lookup(3KSTAT)

kstat_lookup(3KSTAT)

kstat_open(3KSTAT)

kstat_read(3KSTAT)

kstat_write(3KSTAT)

kvm_close(3KVM)

kvm_getcmd(3KVM)

kvm_getproc(3KVM)

kvm_getu(3KVM)

kvm_kread(3KVM)

kvm_kwrite(3KVM)

kvm_nextproc(3KVM)

kvm_nlist(3KVM)

kvm_open(3KVM)

kvm_read(3KVM)

kvm_setproc(3KVM)

kvm_uread(3KVM)

kvm_uwrite(3KVM)

kvm_write(3KVM)

ldexp(3M)

ldexpf(3M)

ldexpl(3M)

lgamma(3M)

lgammaf(3M)

lgammaf_r(3M)

lgammal(3M)

lgammal_r(3M)

lgamma_r(3M)

lgrp_affinity_get(3LGRP)

lgrp_affinity_inherit_get(3LGRP)

lgrp_affinity_inherit_set(3LGRP)

lgrp_affinity_set(3LGRP)

lgrp_children(3LGRP)

lgrp_cookie_stale(3LGRP)

lgrp_cpus(3LGRP)

lgrp_fini(3LGRP)

lgrp_home(3LGRP)

lgrp_init(3LGRP)

lgrp_latency(3LGRP)

lgrp_latency_cookie(3LGRP)

lgrp_mem_size(3LGRP)

lgrp_nlgrps(3LGRP)

lgrp_parents(3LGRP)

lgrp_resources(3LGRP)

lgrp_root(3LGRP)

lgrp_version(3LGRP)

lgrp_view(3LGRP)

llrint(3M)

llrintf(3M)

llrintl(3M)

llround(3M)

llroundf(3M)

llroundl(3M)

log10(3M)

log10f(3M)

log10l(3M)

log1p(3M)

log1pf(3M)

log1pl(3M)

log2(3M)

log2f(3M)

log2l(3M)

log(3M)

logb(3M)

logbf(3M)

logbl(3M)

logf(3M)

logl(3M)

lrint(3M)

lrintf(3M)

lrintl(3M)

lround(3M)

lroundf(3M)

lroundl(3M)

maillock(3MAIL)

mailunlock(3MAIL)

matherr(3M)

m_create_layout(3LAYOUT)

m_destroy_layout(3LAYOUT)

m_getvalues_layout(3LAYOUT)

mkdirp(3GEN)

modf(3M)

modff(3M)

modfl(3M)

mp(3MP)

MP_AssignLogicalUnitToTPG(3MPAPI)

MP_CancelOverridePath(3MPAPI)

MP_CompareOIDs(3MPAPI)

MP_DeregisterForObjectPropertyChanges(3MPAPI)

MP_DeregisterForObjectVisibilityChanges(3MPAPI)

MP_DeregisterPlugin(3MPAPI)

MP_DisableAutoFailback(3MPAPI)

MP_DisableAutoProbing(3MPAPI)

MP_DisablePath(3MPAPI)

MP_EnableAutoFailback(3MPAPI)

MP_EnableAutoProbing(3MPAPI)

MP_EnablePath(3MPAPI)

MP_FreeOidList(3MPAPI)

mp_gcd(3MP)

MP_GetAssociatedPathOidList(3MPAPI)

MP_GetAssociatedPluginOid(3MPAPI)

MP_GetAssociatedTPGOidList(3MPAPI)

MP_GetDeviceProductOidList(3MPAPI)

MP_GetDeviceProductProperties(3MPAPI)

MP_GetInitiatorPortOidList(3MPAPI)

MP_GetInitiatorPortProperties(3MPAPI)

MP_GetLibraryProperties(3MPAPI)

MP_GetMPLogicalUnitProperties(3MPAPI)

MP_GetMPLuOidListFromTPG(3MPAPI)

MP_GetMultipathLus(3MPAPI)

MP_GetObjectType(3MPAPI)

MP_GetPathLogicalUnitProperties(3MPAPI)

MP_GetPluginOidList(3MPAPI)

MP_GetPluginProperties(3MPAPI)

MP_GetProprietaryLoadBalanceOidList(3MPAPI)

MP_GetProprietaryLoadBalanceProperties(3MPAPI)

MP_GetTargetPortGroupProperties(3MPAPI)

MP_GetTargetPortOidList(3MPAPI)

MP_GetTargetPortProperties(3MPAPI)

mp_itom(3MP)

mp_madd(3MP)

mp_mcmp(3MP)

mp_mdiv(3MP)

mp_mfree(3MP)

mp_min(3MP)

mp_mout(3MP)

mp_msqrt(3MP)

mp_msub(3MP)

mp_mtox(3MP)

mp_mult(3MP)

mp_pow(3MP)

MP_RegisterForObjectPropertyChanges(3MPAPI)

MP_RegisterForObjectVisibilityChanges(3MPAPI)

MP_RegisterPlugin(3MPAPI)

mp_rpow(3MP)

mp_sdiv(3MP)

MP_SetFailbackPollingRate(3MPAPI)

MP_SetLogicalUnitLoadBalanceType(3MPAPI)

MP_SetOverridePath(3MPAPI)

MP_SetPathWeight(3MPAPI)

MP_SetPluginLoadBalanceType(3MPAPI)

MP_SetProbingPollingRate(3MPAPI)

MP_SetProprietaryProperties(3MPAPI)

MP_SetTPGAccess(3MPAPI)

mp_xtom(3MP)

m_setvalues_layout(3LAYOUT)

m_transform_layout(3LAYOUT)

m_wtransform_layout(3LAYOUT)

nan(3M)

nanf(3M)

nanl(3M)

nearbyint(3M)

nearbyintf(3M)

nearbyintl(3M)

nextafter(3M)

nextafterf(3M)

nextafterl(3M)

nexttoward(3M)

nexttowardf(3M)

nexttowardl(3M)

p2close(3GEN)

p2open(3GEN)

pathfind(3GEN)

pow(3M)

powf(3M)

powl(3M)

regexpr(3GEN)

remainder(3M)

remainderf(3M)

remainderl(3M)

remquo(3M)

remquof(3M)

remquol(3M)

rint(3M)

rintf(3M)

rintl(3M)

rmdirp(3GEN)

round(3M)

roundf(3M)

roundl(3M)

scalb(3M)

scalbf(3M)

scalbl(3M)

scalbln(3M)

scalblnf(3M)

scalblnl(3M)

scalbn(3M)

scalbnf(3M)

scalbnl(3M)

signbit(3M)

significand(3M)

significandf(3M)

significandl(3M)

sin(3M)

sincos(3M)

sincosf(3M)

sincosl(3M)

sinf(3M)

sinh(3M)

sinhf(3M)

sinhl(3M)

sinl(3M)

sqrt(3M)

sqrtf(3M)

sqrtl(3M)

step(3GEN)

strcadd(3GEN)

strccpy(3GEN)

streadd(3GEN)

strecpy(3GEN)

strfind(3GEN)

strrspn(3GEN)

strtrns(3GEN)

Sun_MP_SendScsiCmd(3MPAPI)

tan(3M)

tanf(3M)

tanh(3M)

tanhf(3M)

tanhl(3M)

tanl(3M)

tgamma(3M)

tgammaf(3M)

tgammal(3M)

touchlock(3MAIL)

trunc(3M)

truncf(3M)

truncl(3M)

vatan2_(3MVEC)

vatan2f_(3MVEC)

vatan_(3MVEC)

vatanf_(3MVEC)

vc_abs_(3MVEC)

vc_exp_(3MVEC)

vc_log_(3MVEC)

vcos_(3MVEC)

vcosf_(3MVEC)

vcospi_(3MVEC)

vcospif_(3MVEC)

vc_pow_(3MVEC)

vexp_(3MVEC)

vexpf_(3MVEC)

vhypot_(3MVEC)

vhypotf_(3MVEC)

vlog_(3MVEC)

vlogf_(3MVEC)

vpow_(3MVEC)

vpowf_(3MVEC)

vrhypot_(3MVEC)

vrhypotf_(3MVEC)

vrsqrt_(3MVEC)

vrsqrtf_(3MVEC)

vsin_(3MVEC)

vsincos_(3MVEC)

vsincosf_(3MVEC)

vsincospi_(3MVEC)

vsincospif_(3MVEC)

vsinf_(3MVEC)

vsinpi_(3MVEC)

vsinpif_(3MVEC)

vsqrt_(3MVEC)

vsqrtf_(3MVEC)

vz_abs_(3MVEC)

vz_exp_(3MVEC)

vz_log_(3MVEC)

vz_pow_(3MVEC)

y0(3M)

y0f(3M)

y0l(3M)

y1(3M)

y1f(3M)

y1l(3M)

yn(3M)

ynf(3M)

ynl(3M)

matherr

- math library exception-handling function

Synopsis

#include <math.h>

int matherr(struct exception *exc);

Description

The System V Interface Definition, Third Edition (SVID3) specifies that certain libm functions call matherr() when exceptions are detected. Users may define their own mechanisms for handling exceptions, by including a function named matherr() in their programs. The matherr() function is of the form described above. When an exception occurs, a pointer to the exception structure exc will be passed to the user-supplied matherr() function. This structure, which is defined in the <math.h> header file, is as follows:

struct exception {
    int type;
    char *name;
    double arg1, arg2, retval;
};

The type member is an integer describing the type of exception that has occurred, from the following list of constants (defined in the header file):

DOMAIN

argument domain exception

SING

argument singularity

OVERFLOW

overflow range exception

UNDERFLOW

underflow range exception

TLOSS

total loss of significance

PLOSS

partial loss of significance

Both TLOSS and PLOSS reflect limitations of particular algorithms for trigonometric functions that suffer abrupt declines in accuracy at definite boundaries. Since the implementation does not suffer such abrupt declines, PLOSS is never signaled. TLOSS is signaled for Bessel functions only to satisfy SVID3 requirements.

The name member points to a string containing the name of the function that incurred the exception. The arg1 and arg2 members are the arguments with which the function was invoked. retval is set to the default value that will be returned by the function unless the user's matherr() sets it to a different value.

If the user's matherr() function returns non-zero, no exception message will be printed and errno is not set.

SVID3 STANDARD CONFORMANCE

When an application is built as a SVID3 conforming application (see standards(5)), if matherr() is not supplied by the user, the default matherr exception-handling mechanisms, summarized in the table below, are invoked upon exception:

DOMAIN

0.0 is usually returned, errno is set to EDOM and a message is usually printed on standard error.

SING

The largest finite single-precision number, HUGE of appropriate sign, is returned, errno is set to EDOM, and a message is printed on standard error.

OVERFLOW

The largest finite single-precision number, HUGE of appropriate sign, is usually returned and errno is set to ERANGE.

UNDERFLOW

0.0 is returned and errno is set to ERANGE.

TLOSS

0.0 is returned, errno is set to ERANGE, and a message is printed on standard error.

In general, errno is not a reliable error indicator because it can be unexpectedly set by a function in a handler for an asynchronous signal.

SVID3 ERROR HANDLING PROCEDURES (compile with cc \-Xt)

<math.h> type
DOMAIN
SING
OVERFLOW
UNDERFLOW
TLOSS
errno
EDOM
EDOM
ERANGE
ERANGE
ERANGE
IEEE Exception
Invalid Operation
Division by Zero
Overflow
Underflow
-
fp_exception_type
fp_invalid
fp_division
fp_overflow
fp_underflow
-
ACOS, ASIN (|x| > 1):
Md, 0.0
-
-
-
-
ACOSH (x < 1), ATANH (|x| > 1):
NaN
-
-
-
-
ATAN2 (0,0):
Md, 0.0
-
-
-
-
COSH, SINH:
-
-
±HUGE
-
-
EXP:
-
-
+HUGE
0.0
-
FMOD (x,0):
x
-
-
-
-
HYPOT:
-
-
+HUGE
-
-
J0, J1, JN (|x| > X_TLOSS):
-
-
-
-
Mt, 0.0
LGAMMA:
usual cases
-
-
+HUGE
-
-
(x = 0 or -integer)
-
Ms, +HUGE
-
-
-
LOG, LOG10:
(x < 0)
Md, -HUGE
-
-
-
-
(x = 0)
-
Ms, -HUGE
-
-
-
POW:
usual cases
-
-
±HUGE
±0.0
-
(x < 0) ** (y not an integer)
Md, 0.0
-
-
-
-
0 ** 0
Md, 0.0
-
-
-
-
0 ** (y < 0)
Md, 0.0
-
-
-
REMAINDER (x,0):
NaN
-
-
-
-
SCALB:
-
-
±HUGE_VAL
±0.0
-
SQRT (x < 0):
Md, 0.0
-
-
-
-
Y0, Y1, YN:
(x < 0)
Md, -HUGE
-
-
-
-
(x = 0)
-
Md, -HUGE
-
-
-
(x > X_TLOSS)
-
-
-
-
Mt, 0.0

Abbreviations

Md

Message is printed (DOMAIN error).

Ms

Message is printed (SING error).

Mt

Message is printed (TLOSS error).

NaN

IEEE NaN result and invalid operation exception.

HUGE

Maximum finite single-precision floating-point number.

HUGE_VAL

IEEE ∞ result and division-by-zero exception.

X_TLOSS

The value X_TLOSS is defined in <values.h>.

The interaction of IEEE arithmetic and matherr() is not defined when executing under IEEE rounding modes other than the default round to nearest: matherr() is not always called on overflow or underflow and can return results that differ from those in this table.

X/OPEN COMMON APPLICATION ENVIRONMENT (CAE) SPECIFICATIONS CONFORMANCE

The X/Open System Interfaces and Headers (XSH) Issue 3 and later revisions of that specification no longer sanctions the use of the matherr interface. The following table summarizes the values returned in the exceptional cases. In general, XSH dictates that as long as one of the input argument(s) is a NaN, NaN is returned. In particular, pow(NaN,0) = NaN.

CAE SPECIFICATION ERROR HANDLING PROCEDURES (compile with cc -Xa)

<math.h> type
DOMAIN
SING
OVERFLOW
UNDERFLOW
TLOSS
errno
EDOM
EDOM
ERANGE
ERANGE
ERANGE
ACOS, ASIN (|x| > 1):
0.0
-
-
-
-
ATAN2 (0,0):
0.0
-
-
-
-
COSH, SINH:
-
-
{±HUGE_VAL}
-
-
EXP:
-
-
{+HUGE_VAL}
{0.0}
-
FMOD (x,0):
{NaN}
-
-
-
-
HYPOT:
-
-
{+HUGE_VAL}
-
-
J0, J1, JN (|x| > X_TLOSS):
-
-
-
-
{0.0}
LGAMMA:
usual cases
-
-
{+HUGE_VAL}
-
-
(x = 0 or -integer)
-
+HUGE_VAL
-
-
-
LOG, LOG10:
(x < 0)
-HUGE_VAL
-
-
-
-
(x = 0)
-
-HUGE_VAL
-
-
-
POW:
usual cases
-
-
±HUGE_VAL
±0.0
-
(x < 0) ** (y not an integer)
0.0
-
-
-
-
0 ** 0
{1.0}
-
-
-
-
0 ** (y < 0)
{-HUGE_VAL}
-
-
-
-
SQRT (x < 0):
0.0
-
-
-
-
Y0, Y1, YN:
(x < 0)
{-HUGE_VAL}
-
-
-
-
(x = 0)
-
{-HUGE_VAL}
-
-
-
(x > X_TLOSS)
-
-
-
-
0.0

Abbreviations

{...}

errno is not to be relied upon in all braced cases.

NaN

IEEE NaN result and invalid operation exception.

HUGE_VAL

IEEE ∞ result and division-by-zero exception.

X_TLOSS

The value X_TLOSS is defined in <values.h>.

ANSI/ISO-C STANDARD CONFORMANCE

The ANSI/ISO-C standard covers a small subset of the CAE specification.

The following table summarizes the values returned in the exceptional cases.

ANSI/ISO-C ERROR HANDLING PROCEDURES (compile with cc -Xc)

<math.h> type
DOMAIN
SING
OVERFLOW
UNDERFLOW
errno
EDOM
EDOM
ERANGE
ERANGE
ACOS, ASIN (|x| > 1):
0.0
-
-
-
ATAN2 (0,0):
0.0
-
-
-
EXP:
-
-
+HUGE_VAL
0.0
FMOD (x,0):
NaN
-
-
-
LOG, LOG10:
(x < 0)
-HUGE_VAL
-
-
-
(x = 0)
-
-HUGE_VAL
-
-
POW:
usual cases
-
-
±HUGE_VAL
±0.0
(x < 0) ** (y not an integer)
0.0
-
-
-
0 ** (y < 0)
-HUGE_VAL
-
-
-
SQRT (x < 0):
0.0
-
-
-

ABBREVIATIONS

NaN

IEEE NaN result and invalid operation exception.

HUGE_VAL

IEEE ∞ result and division-by-zero.

Examples

Example 1 Example of matherr() function

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int
matherr(struct exception *x) {
    switch (x->type) {
        case DOMAIN:
            /* change sqrt to return sqrt(-arg1), not NaN */
   if (!strcmp(x->name, "sqrt")) {
    x->retval = sqrt(-x->arg1);
    return (0); /* print message and set errno */
   } /* FALLTHRU */
  case SING:
   /* all other domain or sing exceptions, print message and */
   /* abort */
   fprintf(stderr, "domain exception in %s\n", x->name);
   abort( );
   break;
  }
  return (0); /* all other exceptions, execute default procedure */
 }

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
MT-Level
MT-Safe

See Also

attributes(5), standards(5)