Re: Real C++ compile problems
Re: Real C++ compile problems
- Subject: Re: Real C++ compile problems
- From: Ken Turkowski <email@hidden>
- Date: Sat, 26 Jun 2004 23:22:12 -0700
On Jun 26, 2004, at 10:01 PM, "email@hidden"
<email@hidden> wrote:
My program compiles and runs fine in unix, whereas in Xcode my errors
are:
square.h:32: error: call of overloaded `sqrt(int)' is ambiguous
math.h:302: error: candidates are: double sqrt(double)
cmath:461: error: float std::sqrt(float)
cmath:465: error: long double std::sqrt(long double)
It looks like its having trouble with my sqrt calls. I dont know why
its saying the call is overloaded. Also I didnt write the math.h or
cmath.h programs, so I hope theres no errors there.
You're using C++. Some machines have several precisions of the math
library implemented. It seems that your UNIX system doesn't have other
than the default double precision, whereas XCode does.
Instead of using
sqrt(2)*getSide();}
try
sqrt(2.0)*getSide();}
or
sqrt(2.0f)*getSide();}
if getSide is an integer and is less than 16777216, or if you only need
24 bits of precision.
--
Ken Turkowski email@hidden
Engineer/Scientist http://www.worldserver.com/turk/
Independent Consultant Industrial Grade Software
Computer Graphics 2D 3D Immersive Imagery
Photo-mosaicing Panoramas Computer Vision
Applied Mathematics Numerical Analysis Optimization
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.