math.h (sqrt, pow)
Në shqip përdoret i njëjti emër.
ShpjegimiSQ
Header-i <math.h> ka funksione matematikore: sqrt(), pow(), fabs(), sin(), round(). Në Linux duhet t'i thuash kompajlerit ta lidhë librarinë me -lm, përndryshe del gabim „undefined reference to sqrt“.
EnglishEN
The <math.h> header has maths functions: sqrt(), pow(), fabs(), sin(), round(). On Linux you must tell the compiler to link the library with -lm, otherwise you get “undefined reference to sqrt”.
Si ta mendosh
Si kalkulatori shkencor që duhet ta futësh në çantë para provimit.
Lexoje në anglisht
Like the scientific calculator you have to pack before the exam.
Shembull kodic
#include <math.h>
double h = sqrt(3 * 3 + 4 * 4); // 5.0
printf("%.0f\n", pow(2, 10)); // 1024