PDA

View Full Version : little problem



desiboy
04-29-2010, 08:27 AM
Hi guys, I am bit weak in prog...can you pls resolve this prob.

// Calculate power of two padded widths
int p_width = (unsigned) pow( 2.0, ceil( log( loadedimage->w ) / log( 2.0 ) ) );
int p_height = (unsigned) pow( 2.0, ceil( log( loadedimage->h ) / log( 2.0 ) ) );

Problem--->error C2668:'log': ambiguous call to overloaded function

David_pb
04-29-2010, 08:56 AM
I guess loadedimage->w/h are integers? Then you've to cast or use logf:


logf( loadedimage->w ) // or
log( (float)loadedimage->w )