Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #5582

Re: OT: missing C99 math pieces in gcc 4.x on Solaris 8 (sparc)

From Ian Collins <ian-news@hotmail.com>
Newsgroups comp.lang.c
Subject Re: OT: missing C99 math pieces in gcc 4.x on Solaris 8 (sparc)
Date 2011-06-07 07:46 +1200
Message-ID <954p45Fbn8U3@mid.individual.net> (permalink)
References (8 earlier) <5dfe258f-9f3f-4705-8d45-04590a9e7793@s41g2000prb.googlegroups.com> <yI-dnRSTQPbHXnTQnZ2dnUVZ_rSdnZ2d@posted.internetamerica> <isci0a$cha$1@speranza.aioe.org> <950ci9FivcU13@mid.individual.net> <98bcc486-1d5e-4a82-9410-53b0b2741993@s16g2000prf.googlegroups.com>

Show all headers | View raw


On 06/ 7/11 05:17 AM, David Mathog wrote:
>
> where sol8.h is:
>
> #if !defined(SOL8_GUARD)
> #define SOL8_GUARD 1
> #include<ieeefp.h>        /* get Solaris FP_SNAN etc.*/
>
> /* these are the C99 flags */
> # define FP_NAN       0
> # define FP_INFINITE  1
> # define FP_ZERO      2
> # define FP_SUBNORMAL 3
> # define FP_NORMAL    4
>
> # define NAN ( ((double) 0.0)/ ((double) 0.0) )
>
> # define isnormal(x) (fpclass (x)>=
> FP_NZERO                            ? FP_NORMAL   : 0)
> # define isinf(x)    (fpclass (x) == FP_NINF  || fpclass (x) ==
> FP_PINF  ? FP_INFINITE : 0)
> # define isnan(x)    (fpclass (x) == FP_SNAN  || fpclass (x) ==
> FP_QNAN  ? FP_NAN      : 0)
> # define iszero(x)   (fpclass (x) == FP_NZERO || fpclass (x) ==
> FP_PZERO ? FP_ZERO     : 0)
> #define fmax(A,B) ( A>=B ? A : B)
> #define fmin(A,B) ( A<=B ? A : B)
> #define round(A)  ( A>= 0 ? floor(A+0.5) : -floor(-A+0.5) )
>
> int fpclassify(double x){

Shouldn't this be declared "inline"?

> int status;
>    switch(fpclass(x)){
>      case FP_SNAN:
>      case FP_QNAN:     status=FP_NAN;       break;
>      case FP_NINF:
>      case FP_PINF:     status=FP_INFINITE;  break;
>      case FP_NDENORM:
>      case FP_PDENORM:  status=FP_SUBNORMAL; break;
>      case FP_NZERO:
>      case FP_PZERO:    status=FP_ZERO;      break;
>      case FP_NNORM:
>      case FP_PNORM:    status=FP_NORMAL;    break;
>    }
>    return(status);
> }
>
> #endif /* SOL8_GUARD */
>
>
>
>
>
> Regards,
>
> David Mathog
>


-- 
Ian Collins

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

OT: missing C99 math pieces in gcc 4.x on Solaris 8 (sparc) David Mathog <dmathog@gmail.com> - 2011-06-02 13:52 -0700
  Re: OT: missing C99 math pieces in gcc 4.x on Solaris 8 (sparc) Nobody <nobody@nowhere.com> - 2011-06-02 22:16 +0100
  Re: OT: missing C99 math pieces in gcc 4.x on Solaris 8 (sparc) David Mathog <dmathog@gmail.com> - 2011-06-02 14:18 -0700
    Re: OT: missing C99 math pieces in gcc 4.x on Solaris 8 (sparc) David Mathog <dmathog@gmail.com> - 2011-06-02 14:37 -0700
      Re: OT: missing C99 math pieces in gcc 4.x on Solaris 8 (sparc) Ian Collins <ian-news@hotmail.com> - 2011-06-03 09:59 +1200
        Re: OT: missing C99 math pieces in gcc 4.x on Solaris 8 (sparc) David Mathog <dmathog@gmail.com> - 2011-06-02 15:18 -0700
          Re: OT: missing C99 math pieces in gcc 4.x on Solaris 8 (sparc) Ian Collins <ian-news@hotmail.com> - 2011-06-03 10:35 +1200
            Re: OT: missing C99 math pieces in gcc 4.x on Solaris 8 (sparc) David Mathog <dmathog@gmail.com> - 2011-06-02 16:01 -0700
              Re: OT: missing C99 math pieces in gcc 4.x on Solaris 8 (sparc) ImpalerCore <jadill33@gmail.com> - 2011-06-03 06:45 -0700
                Re: OT: missing C99 math pieces in gcc 4.x on Solaris 8 (sparc) David Mathog <dmathog@gmail.com> - 2011-06-03 12:13 -0700
                Re: OT: missing C99 math pieces in gcc 4.x on Solaris 8 (sparc) jacob navia <jacob@spamsink.net> - 2011-06-03 21:35 +0200
                Re: OT: missing C99 math pieces in gcc 4.x on Solaris 8 (sparc) Ian Collins <ian-news@hotmail.com> - 2011-06-04 08:48 +1200
                Re: OT: missing C99 math pieces in gcc 4.x on Solaris 8 (sparc) Nobody <nobody@nowhere.com> - 2011-06-03 23:28 +0100
                Re: OT: missing C99 math pieces in gcc 4.x on Solaris 8 (sparc) gordonb.myhxj@burditt.org (Gordon Burditt) - 2011-06-04 00:32 -0500
                Re: OT: missing C99 math pieces in gcc 4.x on Solaris 8 (sparc) jacob navia <jacob@spamsink.net> - 2011-06-04 08:06 +0200
                Re: OT: missing C99 math pieces in gcc 4.x on Solaris 8 (sparc) gordonb.c5zg9@burditt.org (Gordon Burditt) - 2011-06-04 22:03 -0500
                Re: OT: missing C99 math pieces in gcc 4.x on Solaris 8 (sparc) Ian Collins <ian-news@hotmail.com> - 2011-06-05 15:47 +1200
                Re: OT: missing C99 math pieces in gcc 4.x on Solaris 8 (sparc) jacob navia <jacob@spamsink.net> - 2011-06-05 09:48 +0200
                Re: OT: missing C99 math pieces in gcc 4.x on Solaris 8 (sparc) Ian Collins <ian-news@hotmail.com> - 2011-06-05 20:22 +1200
                Re: OT: missing C99 math pieces in gcc 4.x on Solaris 8 (sparc) jacob navia <jacob@spamsink.net> - 2011-06-05 15:59 +0200
                Re: OT: missing C99 math pieces in gcc 4.x on Solaris 8 (sparc) "Joel C. Salomon" <joelcsalomon@gmail.com> - 2011-06-06 09:09 -0400
                Re: OT: missing C99 math pieces in gcc 4.x on Solaris 8 (sparc) jacob navia <jacob@spamsink.net> - 2011-06-06 15:24 +0200
                Re: OT: missing C99 math pieces in gcc 4.x on Solaris 8 (sparc) David Mathog <dmathog@gmail.com> - 2011-06-06 10:17 -0700
                Re: OT: missing C99 math pieces in gcc 4.x on Solaris 8 (sparc) Ian Collins <ian-news@hotmail.com> - 2011-06-07 07:46 +1200
                Re: OT: missing C99 math pieces in gcc 4.x on Solaris 8 (sparc) David Mathog <dmathog@gmail.com> - 2011-06-09 09:35 -0700
                Re: OT: missing C99 math pieces in gcc 4.x on Solaris 8 (sparc) Keith Thompson <kst-u@mib.org> - 2011-06-09 11:18 -0700
                Re: OT: missing C99 math pieces in gcc 4.x on Solaris 8 (sparc) David Mathog <dmathog@gmail.com> - 2011-06-09 12:52 -0700
                Re: OT: missing C99 math pieces in gcc 4.x on Solaris 8 (sparc) Ian Collins <ian-news@hotmail.com> - 2011-06-10 09:14 +1200
            Re: OT: missing C99 math pieces in gcc 4.x on Solaris 8 (sparc) Keith Thompson <kst-u@mib.org> - 2011-06-02 16:04 -0700

csiph-web