Power
Source Code for Math Functions Log10 Floor Round Power Square Root in C Programming
Following is the source code for math functions Log10, Floor, Round, Power, and Square Root:
#include <math.h>
main()
{
printf("%f %f\n",log10(64)/log10(2),pow(32,0.2));
printf("%f %f\n",floor(6.6),rint(6.6));
printf("%f\n",pow(12,3));
printf("%f\n",sqrt(25));
}
(1 vote)
Power Function using Scheme Source Code
Power function code. Computes like 2^5 = 32
CODE
(define power
(lambda( x y)
(cond((eqv? y 0) 1)
((> y 0) (* (power x (- y 1)) x)))))
(1 vote)
