[gnumeric] Goal Seek: fix some gnm_float issues.



commit 44696966c4dc1ec7eed6ee61e33f56418561a66c
Author: Morten Welinder <terra gnome org>
Date:   Wed Jan 13 16:22:15 2010 -0500

    Goal Seek: fix some gnm_float issues.

 src/tools/ChangeLog   |    5 +++++
 src/tools/goal-seek.c |    8 ++++----
 2 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/src/tools/ChangeLog b/src/tools/ChangeLog
index 5b4ecdf..3f4371c 100644
--- a/src/tools/ChangeLog
+++ b/src/tools/ChangeLog
@@ -1,3 +1,8 @@
+2010-01-13  Morten Welinder  <terra gnome org>
+
+	* goal-seek.c (goal_seek_newton_polish): Fix some gnm_float
+	issues.
+
 2009-12-31 Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* analysis-auto-expression.c (analysis_tool_auto_expression_engine_run):
diff --git a/src/tools/goal-seek.c b/src/tools/goal-seek.c
index 2db250a..dab1e4f 100644
--- a/src/tools/goal-seek.c
+++ b/src/tools/goal-seek.c
@@ -203,8 +203,8 @@ goal_seek_newton_polish (GoalSeekFunction f, GoalSeekFunction df,
 
 	for (iterations = 0; iterations < 20; iterations++) {
 		if (try_square) {
-			double x1 = x0 * gnm_abs (x0);
-			double y1, r;
+			gnm_float x1 = x0 * gnm_abs (x0);
+			gnm_float y1, r;
 			GoalSeekStatus status = f (x1, &y1, user_data);
 			if (status != GOAL_SEEK_OK)
 				goto nomore_square;
@@ -231,7 +231,7 @@ goal_seek_newton_polish (GoalSeekFunction f, GoalSeekFunction df,
 		}
 
 		if (try_newton) {
-			double df0, r, x1, y1;
+			gnm_float df0, r, x1, y1;
 			GoalSeekStatus status = df
 				? df (x0, &df0, user_data)
 				: fake_df (f, x0, &df0, gnm_abs (x0) / 1e6, data, user_data);
@@ -388,7 +388,7 @@ goal_seek_newton (GoalSeekFunction f, GoalSeekFunction df,
 			 * Verify that we made progress using our
 			 * potentially bogus df0.
 			 */
-			double y1;
+			gnm_float y1;
 
 			if (x1 < data->xmin || x1 > data->xmax)
 				return GOAL_SEEK_ERROR;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]