Yea, pow() operates on floating point numbers, so they're not always exactly correct - then, when they get converted to integers, they're truncated, not rounded, so you may be off by 1. You could try adding 0.1 or 0.001 or something to the result, that might help.
when they get converted to integers, they're truncated, not rounded, so you may be off by 1. You could try adding 0.1 or 0.001 or something to the result
To get rounding instead of truncation, adding 0.5 is what you want, no?
Well, it looks like this is just a case of a difference between what the UI generates, and what the Makefile generates. Still more to figure out there, but the same sketch built with make is larger, and has the above behavior, while the one compiled and loaded through the UI works fine.
Sorry for falsely accusing pow() of falling down on the job...