🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.migration
Article #182

Re: C++ Builder 6 / 2006 floating point differences (and a crash)

#182
From: Joe Pasquariello
Date: Fri, 15 Sep 2006 15:27
47 lines
2705 bytes
Hi David,

This may be relevant. A floating point exception can be caused simply by
assigning an invalid value to a variable. You don't have to "use" the value
to get an exception.

Joe


"David M" <davidm@sonardata.com> wrote in message
news:44d94e46@newsgroups.borland.com...
> Hi,
>
> Recently we converted a large project to C++Builder 2006 from 6, and the
> conversion has gone fine and the software works perfectly, except for one
> odd issue.  Sometimes there are odd floating point exceptions in code that
> worked fine with CB6, and isn't code you'd expect to cause an exception.
>
> The specific example I'm trying to figure out at the moment is calling a
> getter method on a class which returns a double:
>     double dMax = foo.GetMax();
> where GetMax is defined as:
>     double FooClass::GetMax() { return m_dMax; }
> and using it:
>     bar->SetGeometry(dMin, dMax);
> will throw an EInvalidOp either in the GetMax method or when entering the
> SetGeometry method before the first line of code is executed.
>
> The value of dMax in this case is very small, but as far as I know that
> shouldn't matter.  No maths is being done with it at this stage, it's just
> being passed around.  So, why is there a EInvalidOp exception?  (And what
> operation would it be in the first place, that's invalid?  Nothing is
> actually being done to it...?)
>
> I've googled for similar problems and found a couple of other people
who've
> reported the same thing, again after transitions to 2006 from 6, but no
> answers as to the cause or a solution.  If anyone has any insight, it
would
> be much appreciated!
>
> Cheers,
>
> David
>
>
>
Technical Details
Message-ID: <450ac685$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news-lond.gip.net!news.gsl.net!gip.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <44d94e46@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 110f51,d8618f84997f7698
X-Google-Attributes: gid110f51,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Joe Pasquariello" <joep@fenway.com>
Newsgroups: borland.public.cppbuilder.migration
References: <44d94e46@newsgroups.borland.com>
Subject: Re: C++ Builder 6 / 2006 floating point differences (and a crash)
Date: Fri, 15 Sep 2006 08:27:58 -0700
Lines: 49
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1807
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807
NNTP-Posting-Host: 71.131.21.77
Message-ID: <450ac685$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1158334085 71.131.21.77 (15 Sep 2006 08:28:05 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news-lond.gip.net!news.gsl.net!gip.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail