I wrote the following programs to compare the speed of python with c/fortran. To get the time used by the programs I used the \"time\" command. All the programs compute the sq
There are a number of things you should be aware of before you start comparing timings like that.
real
in Fortran and float
in C, so (depending on your system of course) the compiler will probably use the sqrtf
library call in fortran, while in C you use sqrt
instead of sqrtf
, which you should use for a float
.