What is the exact error you are getting, and what is the variable type of the input parameter?
#include <math.h> is the correct thing to do to get pow() and fpow().
spark_wiring_constants.h does not define pow(). And it only defines min, max, constrain, and round when Arduino compatibility mode is enabled, and that defaults to off.
more than one instance of overloaded function “round” matches the argument list: – function template “T round(T x)” (declared at line 57 of “/Users/Ryan/.particle/toolchains/deviceOS/3.1.0/wiring/inc/spark_wiring_constants.h”) – function template “__gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, double>::__type std::round(_Tp __x)” (declared at line 1768 of “/Users/Ryan/.particle/toolchains/gcc-arm/10.2.1/arm-none-eabi/include/c++/10.2.1/cmath”) – argument types are: (int)C/C++(308)
What is the rationale of trying to round a number that already is rounded by definition?
Round only ever makes sense when your parameter is a floating point type.
Hence there is no definition of round() that takes any integer type.
Just a hint on that 3 / 2: This will always be calculated as 1. No matter whether you use round() or not.
A pure int division will always render an int result.
At least one of your parameters of the division operator needs to be a floating point type to render a floating point result.
Since a pure int can be treated as float, double or long double the compiler is unsure what to use.
Sorry, I was just trying to make it a simple example that also breaks.
The actual line is Count = round(PixelCount() / 2). But to your point, PixelCount() also returns an Int.
If I do this: Count = round(float(PixelCount() / 2), it now compiles fine. But, also to your point, it is unnecessary, as it will just round anyway because they are both ints correct?
A division 3.0 / 2 (float / int) will produce a floating point 1.5 and round(1.5) will give you 2.0, but a 3 / 2 (int / int) will produce an integer 1.