Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / September 2006

Tip: Looking for answers? Try searching our database.

math.h / complex - issue porting 2002 app to 2003

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andy - 20 Sep 2006 18:48 GMT
Hi,
I noticed when migrating a 2002 application to 2003 that the system changed
to a different usage for pow(2,-15).
In 2002, it used double pow(double,double).
In 2003, it is using double pow(int,int).
You may note that pow(2,-15) and pow(2.0,-15.0) give different results.
math.h is included.
Is there some way to force studio to not use the complex prototypes?
math.h is the only include file being used.  Why is it even linking to the
others?
Is there a project option to control that?
I'd rather not go through and verify every math operation in this code for
prototype changes..
David W - 22 Sep 2006 00:19 GMT
> Hi,
> I noticed when migrating a 2002 application to 2003 that the system changed
[quoted text clipped - 9 lines]
> I'd rather not go through and verify every math operation in this code for
> prototype changes..

The compiler is going to choose the function that has matching argument types, if one is present,
since that's a C++ requirement. If pow(int, int) has been added to <math.h> since 2002 then it's
going to choose that for 2, -15. I don't see how any project options could change the language rules
just for math functions, and I don't see any #ifdefs in the header for excluding the new functions
in C++. I suspect that you're going to have to pass doubles if you want pow(double, double) or
compile it as C instead of C++. My knowledge of 2003 (and 2002) is very limited, however.

DW

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.