MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / est_square_root

Function est_square_root

test/sqlite/speedtest1.c:407–417  ·  view source on GitHub ↗

Estimate the square root of an integer */

Source from the content-addressed store, hash-verified

405
406/* Estimate the square root of an integer */
407static int est_square_root(int x){
408 int y0 = x/2;
409 int y1;
410 int n;
411 for(n=0; y0>0 && n<10; n++){
412 y1 = (y0 + x/y0)/2;
413 if( y1==y0 ) break;
414 y0 = y1;
415 }
416 return y0;
417}
418
419/*
420** The main and default testset

Callers 1

testset_mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected