#include float sqrtf( float n ) { float g = n / (float)2.0; while( ( ( g*g ) - n ) > 0.000001 ) { g = ( g + n/g ) / (float)2.0; } return g; } void main( void ) { float a = (float)0.01125, b = (float)-43.22, c = (float)41173.39500009608; float two = 2.0, four = 4.0; float b2 = b * b; float ac4 = four * a * c; float sqrtbit = sqrtf( b2 - ac4 ); float a2 = two * a; float r1 = ( -b + sqrtbit ) / a2; float r2 = ( -b - sqrtbit ) / a2; printf( "b2:%f ac4:%f sqrt:%f a2:%f\n", b2, ac4, sqrtbit, a2 ); printf( "roots: %f , %f\n", r1, r2 ); } #### C:\test>quads b2:1867.968506 ac4:1852.802856 sqrt:3.894310 a2:0.022500 roots: 2093.969238 , 1747.808472