This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
Re: HUGE is missing in math.h
- From: Yitzchak Scott-Thoennes <sthoenna at efn dot org>
- To: cygwin at cygwin dot com, newlib at sources dot redhat dot com
- Date: Mon, 27 Jun 2005 12:20:50 -0700
- Subject: Re: HUGE is missing in math.h
- References: <83d0063b0506260937400a44d3@mail.gmail.com> <20050627074319.GA383@calimero.vinschen.de>
On Mon, Jun 27, 2005 at 09:43:19AM +0200, Corinna Vinschen wrote:
> On Jun 26 09:37, Humberto Bortolossi wrote:
> > Hi!
> >
> > I'm trying to port a C program written originally in
> > Linux to the Microsoft Windows plataform.
> >
> > I've realized that math.h under cygwin doesn't
> > define the macro HUGE, that is defined in
> > the math.h under linux:
> >
> > /* Declarations for math functions.
> > Copyright (C) 1991-1993,1995-1999,2001,2002 Free Software Foundation, Inc.
> > This file is part of the GNU C Library.
> > */
> > /* SVID mode specifies returning this large value instead of infinity. */
> > # define HUGE 3.40282347e+38F
> >
> > I thought math.h should be quite portable ...
>
> HUGE is not portable. It's not defined in the standard, see
> http://www.opengroup.org/onlinepubs/009695399/basedefs/math.h.html
> Use HUGE_VAL instead.
Or maybe he wants MAXFLOAT (largest finite value representable in
smallest size float).