← Back to team overview

kicad-developers team mailing list archive

Math function call note.


Just a quick note when using math function calls (sqrt, tan, cos, etc),
please cast integer parameters to the correct type (float, double, or
long double) to prevent some compilers (VC++ for one but there may be
others) from generating an ambiguous function call errors. Apparently
GCC automatically casts them to doubles or determines what type they are
being used as and casts them to the appropriate type. I am actually
surprised that GCC doesn't complain about this as all of the math
functions defined in math.h in Linux and MinGW have a float, double, and
long double definition.



Follow ups