Original Post
Okay, I'm trying to use the log function... but the answer it's returning is just plain wrong.
if (structure->w >= structure->h)
structure->qu = (short unsigned int)(log(structure->w)/log(2));
else
structure->qu = (short unsigned int)(log(structure->h)/log(2)); Okay. Structure->w == 64, and structure->h == 64. However, struture->qu is set to 5. It should be set to 6. I've verified the variables before and after the functions, they're 64 throughout. I checked the result with a calculator, and on the calculator, I'm getting 6, yet the computer still smacks a 5 in there. Any idea as to why this might happening?