Search Results

Search found 1 results on 1 pages for 'craz'.

Page 1/1 | 1 

  • C Different answers for a variable when running 'Debug' and 'Start without debug'

    - by Craz
    I keep getting this weird output from my code everytime I use the 'start without degugging' (ctrl-F5) as opposed to normal 'debug' (F5). When I try to find the following value of norm_differnece in debug (pressing F5) mode, it gives me the correct answer for norm_difference normdifference = 1.000000 but in 'start without debugging' (pressing ctrl-f5) the wrong output normdifference = 1456816083547664100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 The following is a segment of code which is gives the output Note: X[] = is a array of stored DOUBLE values for(i=0;i<n;i++){ sum_difference += (pow((X[i*n]-X[i]),2)); } norm_difference = sqrt(norm_difference); for(i=0;i<n;i++){ sum_norm_1 += pow(X[i],2); } norm_1 = sqrt(norm_1); //Take square root of the sum of squares for the row printf("normdifference = %f \n norm_1 = %f \n",norm_difference,norm_1);

    Read the article

1