#include #include "MathFunctions.h" // a hack square root calculation using simple operations double mysqrt(double x) { if (x <= 0) { return 0; } double result; double delta; result = x; // do ten iterations int i; for (i = 0; i < 10; ++i) { if (result <= 0) { result = 0.1; } delta = x - (result*result); result = result + 0.5*delta/result; fprintf(stdout,"Computing sqrt of %g to be %g\n",x,result); } return result; }
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhypnotoad <yoda@etoyoc.com>2017-09-25 16:23:56 (GMT)
committerhypnotoad <yoda@etoyoc.com>2017-09-25 16:23:56 (GMT)
commitda869353bd4824d69fa3756a5336f08db6b7e997 (patch)
treefbf974444e657477f32f2d0b74772f8c13dd70ab /win/tclWinTime.c
parentcd7269ab4485bfd59094b17245b3ab9c943c6ff2 (diff)
downloadtcl-core_zip_vfs.zip
tcl-core_zip_vfs.tar.gz
tcl-core_zip_vfs.tar.bz2
Improvements to Tip#430 based on community input. Added a forward declaration of TclZipfs_Init. Added TclZipfs_Mount() and TclZifs_Unmount to stubs table.core_zip_vfs