User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » C++ why can't I get ceil() to work? Page [1]  
jaZon
All American
27048 Posts
user info
edit post

Anyone mind telling me? Won't compile - keeps throwing "ambiguous call to overloaded function" at me.

I even typecasted the shit out of everything and still nothing.

10/8/2007 8:58:51 PM

moron
All American
34024 Posts
user info
edit post

you tried casting it IN the function call too?

like

ceil((double)1234)

?

10/8/2007 9:06:28 PM

jaZon
All American
27048 Posts
user info
edit post

yea

10/8/2007 9:16:56 PM

moron
All American
34024 Posts
user info
edit post

http://msdn2.microsoft.com/en-us/library/system.math.ceiling.aspx

This is not your problem is it?

http://www.mersenneforum.org/showthread.php?t=1300

or maybe this?

From what I understand (which admittedly is not that much) it's either a particularity of your compiler how it wants it, or you have somehow borked the ceil() function.

10/8/2007 9:25:11 PM

jaZon
All American
27048 Posts
user info
edit post

Yep, exact problem, it seems, but for whatever reason casting the variables in the function isn't helping.

i b0rked it i guess

thanks man

[Edited on October 8, 2007 at 9:51 PM. Reason : ]

10/8/2007 9:30:03 PM

moron
All American
34024 Posts
user info
edit post

Make sure you are saving your file before you compile

10/8/2007 9:37:55 PM

jaZon
All American
27048 Posts
user info
edit post

At first I thought that was the problem, LOL.

I'm sure I made some other stupid mistake that's leading to this. At least I have part of it fixed

10/8/2007 9:50:50 PM

Genki
All American
590 Posts
user info
edit post

ceil((double)1234.0) try changing it to that?

[Edited on October 8, 2007 at 10:32 PM. Reason : .]

10/8/2007 10:31:01 PM

BigMan157
no u
103352 Posts
user info
edit post

you didn't forget the include file, did you?

10/9/2007 12:48:45 PM

GraniteBalls
Aging fast
12262 Posts
user info
edit post

what compiler are you using?

10/9/2007 1:00:41 PM

jaZon
All American
27048 Posts
user info
edit post

^^^ only fucks up w/ variables

^^ no

^ effing visual studio 2005. i'm sure that's the problem

[Edited on October 9, 2007 at 5:16 PM. Reason : ]

10/9/2007 5:15:49 PM

JaegerNCSU
Veteran
245 Posts
user info
edit post

Why don't you post a few lines of code that exhibit the problem? Be sure to show which headers you are including as well.

[Edited on October 9, 2007 at 7:59 PM. Reason : .]

10/9/2007 7:53:58 PM

joe_schmoe
All American
18758 Posts
user info
edit post

yeah, theres no way to tell whats wrong unless you put the code here.

10/10/2007 1:20:33 AM

jaZon
All American
27048 Posts
user info
edit post

eh, i switched compilers and it worked perfectly. i dunno.

i'll post the code later when i get back to what i was screwing with

[Edited on October 10, 2007 at 2:44 AM. Reason : ]

10/10/2007 2:44:08 AM

dakota_man
All American
26584 Posts
user info
edit post

this works fine for me with VS2K5, math.h and the following

int rc = 0;
int passme = 1;
rc = ceil((double)passme);

10/10/2007 10:52:38 AM

 Message Boards » Tech Talk » C++ why can't I get ceil() to work? Page [1]  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.38 - our disclaimer.