little problem

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

I guess loadedimage->w/h are integers? Then you’ve to cast or use logf:


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