[ksh93-integration-discuss] Re: C99 defines |HUGE_VAL| but no |ishugeval()| ?

Roland Mainz roland.mainz at nrubsig.org
Sun Nov 12 20:30:49 PST 2006


Don Cragun wrote:
> >[This is slightly offtopic for ksh93 (or better: It may be interesting
> >for the C99 math stuff... or not...)]
> >
> >Question for our standard+compiöer experts:
> >C99 defines |HUGE_VAL|, |HUGE_VALF| and |HUGE_VALL| but there seems to
> >be no |ishugeval()| function (at least /usr/include/iso/math_c99.h
> >doesn't have such a function) to probe for this value while |NaN| and
> >|+Inf|/|-Inf| have such probing functions (e.g. |isinf()|, |isnan()|) -
> >is that an oversight in the C99 standard or something obmitted
> >intentional ?

> I forwarded this question to the Chair of the ISO committee
> responsible for the C99 standard.  Part of his response was:
> 
> >     "isinf() and isnan() are macros not functions in C99 they are
> >     defined as macros in subclause 7.12.3 Classification macros.
> > 
> >     "The other macros defined by this subclause are:
> >        fpclassify()
> >        isfinite()
> >        isnormal()
> >        signbit()
> > 
> >     So, I wouldn't call it an oversight, HUGEVAL has nothing to
> >     do with the classification of a floating-point values."
> 
> Hope this helps,

Mhhh, I am just wondering why HUGEVAL is treated slightly differently.

The include "/usr/include/iso/math_c99.h" has the following section:
-- snip --
#if defined(_STDC_C99) || _XOPEN_SOURCE - 0 >= 600 ||
defined(__C99FEATURES__)
#if defined(__GNUC__)
#undef  HUGE_VAL
#define HUGE_VAL        (__builtin_huge_val())
#undef  HUGE_VALF
#define HUGE_VALF       (__builtin_huge_valf())
#undef  HUGE_VALL
#define HUGE_VALL       (__builtin_huge_vall())
#undef  INFINITY
#define INFINITY        (__builtin_inff())
#undef  NAN
#define NAN             (__builtin_nanf(""))
-- snip --

|NAN| and |INFINITY| have their matching macros to identify these values
but there is no macro for |HUGE_VAL*|.

I am asking since ksh93s- implemented all the new macros listed in
"/usr/include/iso/math_c99.h" as arithmetic functions and I am wondering
whether it is a loss/problem that there is no |ishugeval()| (maybe it is
neccesary... maybe not... I am still digging for C99 specs which don't
have the label "draft" as title... ;-( ).

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz at nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 7950090
 (;O/ \/ \O;)



More information about the ksh93-integration-discuss mailing list