C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Error C2177 Constant too big when compiling Gammal.c

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated)
View previous topic :: View next topic  
Author Message
XBLite
Guest





PostPosted: Wed Mar 03, 2004 11:43 am    Post subject: Error C2177 Constant too big when compiling Gammal.c Reply with quote



Hi,

I am trying to build the Cephes long double
library using VC++ 4.0. In Gammal.c, I am getting
an error 'Constant too big' for the following line:

if( x > MAXLGM )

where x is defined earlier as:

long double x;

and MAXLGM is defined as:

#define MAXLGM 1.04848146839019521116e+4928L

Anyone have any ideas on why this is occurring?

thanks,
David

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Back to top
Francis Glassborow
Guest





PostPosted: Wed Mar 03, 2004 8:22 pm    Post subject: Re: Error C2177 Constant too big when compiling Gammal.c Reply with quote



In message <7b663d31.0403021439.2520ae4f (AT) posting (DOT) google.com>, XBLite
<dszafranski (AT) wanadoo (DOT) fr> writes
Quote:
Hi,

I am trying to build the Cephes long double
library using VC++ 4.0. In Gammal.c, I am getting
an error 'Constant too big' for the following line:

if( x > MAXLGM )

where x is defined earlier as:

long double x;

and MAXLGM is defined as:

#define MAXLGM 1.04848146839019521116e+4928L

Look at that last (e+4928). 4928 is more than two decimal orders of
magnitude greater than the required minimal upper limit on the exponent
(37 if memory serves me correctly)
Quote:

Anyone have any ideas on why this is occurring?

Yes, you need a compiler that supports a much greater range of values,
though 10^4928 seems quite unreasonable to me. I cannot imagine anything
outside the arcane depths of modern number theory that would require
anything so large.


--
Francis Glassborow ACCU
Author of 'You Can Do It!' see http://www.spellen.org/youcandoit
For project ideas and contributions: http://www.spellen.org/youcandoit/projects


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
Ben Hutchings
Guest





PostPosted: Wed Mar 03, 2004 8:22 pm    Post subject: Re: Error C2177 Constant too big when compiling Gammal.c Reply with quote



XBLite wrote:
Quote:
Hi,

I am trying to build the Cephes long double
library using VC++ 4.0. In Gammal.c, I am getting
an error 'Constant too big' for the following line:

if( x > MAXLGM )

where x is defined earlier as:

long double x;

and MAXLGM is defined as:

#define MAXLGM 1.04848146839019521116e+4928L

Anyone have any ideas on why this is occurring?

In the Win32 versions of Visual C++ (2.0 onwards), long double has the
same representation as double, i.e. 64-bit IEEE double. If you need
the extra range or precision of the 80-bit Intel FP format you'll have
to use a different compiler.

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
XBLite
Guest





PostPosted: Wed Mar 03, 2004 8:51 pm    Post subject: Re: Error C2177 Constant too big when compiling Gammal.c Reply with quote

I can answer this now. VC++4.0 does not support
80 bit long double types. So I guess I will
try another C compiler that can actually
support the 80 bit long double, like
Digital Mars C.

Quote:
I am trying to build the Cephes long double
library using VC++ 4.0. In Gammal.c, I am getting
an error 'Constant too big' for the following line:

if( x > MAXLGM )

where x is defined earlier as:

long double x;

and MAXLGM is defined as:

#define MAXLGM 1.04848146839019521116e+4928L

Anyone have any ideas on why this is occurring?

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
Antoun Kanawati
Guest





PostPosted: Wed Mar 03, 2004 8:51 pm    Post subject: Re: Error C2177 Constant too big when compiling Gammal.c Reply with quote

The constant is a "long double". VC++ 4.0 predates
civilization Smile and did not know about such types
(long-double and long-long).

Try with a current gcc/g++ or VC++. I don't recall
if VC++ 6.x has long doubles, but it's worth a try.

Regular doubles accomodate an exponent of around 300+,
and provide less precision than the constant shown below
requires.

XBLite wrote:

Quote:
Hi,

I am trying to build the Cephes long double
library using VC++ 4.0. In Gammal.c, I am getting
an error 'Constant too big' for the following line:

if( x > MAXLGM )

where x is defined earlier as:

long double x;

and MAXLGM is defined as:

#define MAXLGM 1.04848146839019521116e+4928L

Anyone have any ideas on why this is occurring?

thanks,
David

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
Francis Glassborow
Guest





PostPosted: Thu Mar 04, 2004 2:09 pm    Post subject: Re: Error C2177 Constant too big when compiling Gammal.c Reply with quote

In message <qAn1c.170584$jk2.618726@attbi_s53>, Antoun Kanawati
<antounk (AT) comcast (DOT) net> writes
Quote:
The constant is a "long double". VC++ 4.0 predates
civilization Smile and did not know about such types
(long-double and long-long).
Please check facts before making assertions. long double has been a

required C++ type for at least a dozen years. long long is something
else entirely but MS has been one of the main proponents of it though
there are excellent reasons to argue against long long.
Quote:

Try with a current gcc/g++ or VC++. I don't recall
if VC++ 6.x has long doubles, but it's worth a try.

The issue has nothing to do with whether a compiler supports long
doubles, they all do. The issue is whether they excceed the minimum
standard spec.
Quote:

Regular doubles accomodate an exponent of around 300+,
and provide less precision than the constant shown below
requires.

Again please check the actual requirements, it isn't hard,

--
Francis Glassborow ACCU
Author of 'You Can Do It!' see http://www.spellen.org/youcandoit
For project ideas and contributions: http://www.spellen.org/youcandoit/projects


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
Jack Klein
Guest





PostPosted: Thu Mar 04, 2004 2:13 pm    Post subject: Re: Error C2177 Constant too big when compiling Gammal.c Reply with quote

On 3 Mar 2004 15:51:34 -0500, Antoun Kanawati <antounk (AT) comcast (DOT) net>
wrote in comp.lang.c++.moderated:

Quote:
The constant is a "long double". VC++ 4.0 predates
civilization Smile and did not know about such types
(long-double and long-long).

This is just plain wrong, at least about long double. Microsoft knew
very well what long double was, from version 3.0 of their MS-DOS only
Microsoft C compiler. They supported the Intel coprocessor/FPU 80 bit
extended precision type.

This support continued through all of their 16-bit compilers
(Microsoft C and C++ 7.0, and Visual C++ 1.52). It was only when they
introduced Windows NT and 32 bit compilers that they made a marketing
decision to drop extended precision type.

Their stated reason was that some of the processors for which they
were planning to sell Windows NT did not have hardware support for
floating point types wider than 64 bits. Their decision was that
portability to other processors running Windows NT was more important
than the programmer's decision whether or not to choose precision over
compatibility.

You can see this on Microsoft's web site at the following link:

http://support.microsoft.com/support/kb/articles/Q129/2/09.asp

Quote:
Try with a current gcc/g++ or VC++. I don't recall
if VC++ 6.x has long doubles, but it's worth a try.

Visual C++ 4, 5, and 6 all supported long doubles. But they all
implement long double as 64 bit FPU floating point types, identical
with double. The last version of Visual C++ that supported 80 bit
Intel FPU extended precision 80 bit types for long double was the last
16 bit compiler, Visual C++ 1.52.

I wouldn't know if they have brought this support back in 7.0 or 7.1,
but I doubt it.

Their marketing decision seriously cripples Visual C++ on the x86 for
some types of serious numerical and engineering programming. Others,
such as Borland and GCC, do not have this limitation.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
JN
Guest





PostPosted: Thu Mar 04, 2004 9:57 pm    Post subject: Re: Error C2177 Constant too big when compiling Gammal.c Reply with quote

I'm Curious - what are you doing with a number that big ?

"XBLite" <dszafranski (AT) wanadoo (DOT) fr> wrote

Quote:
Hi,

I am trying to build the Cephes long double
library using VC++ 4.0. In Gammal.c, I am getting
an error 'Constant too big' for the following line:

if( x > MAXLGM )

where x is defined earlier as:

long double x;

and MAXLGM is defined as:

#define MAXLGM 1.04848146839019521116e+4928L

Anyone have any ideas on why this is occurring?

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.