File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -60,15 +60,9 @@ bool bc_sqrt(bc_num *num, size_t scale)
60
60
61
61
/* Initialize the variables. */
62
62
size_t cscale ;
63
- bc_num guess , guess1 , point5 , diff ;
63
+ bc_num guess ;
64
64
size_t rscale = MAX (scale , (* num )-> n_scale );
65
65
66
- bc_init_num (& guess1 );
67
- bc_init_num (& diff );
68
- point5 = bc_new_num (1 , 1 );
69
- point5 -> n_value [1 ] = 5 ;
70
-
71
-
72
66
/* Calculate the initial guess. */
73
67
if (num_cmp_one == BCMATH_RIGHT_GREATER ) {
74
68
/* The number is between 0 and 1. Guess should start at 1. */
@@ -85,6 +79,11 @@ bool bc_sqrt(bc_num *num, size_t scale)
85
79
cscale = 3 ;
86
80
}
87
81
82
+ bc_num guess1 = NULL ;
83
+ bc_num point5 = bc_new_num (1 , 1 );
84
+ point5 -> n_value [1 ] = 5 ;
85
+ bc_num diff = NULL ;
86
+
88
87
/* Find the square root using Newton's algorithm. */
89
88
bool done = false;
90
89
while (!done ) {
You can’t perform that action at this time.
0 commit comments