From c00bcff953c8323cb635475c9f0f3bebab82854e Mon Sep 17 00:00:00 2001 From: Jon Lund Steffensen Date: Sat, 27 Dec 2014 19:30:16 -0500 Subject: redshift: Use double for interpolation function --- src/redshift.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/redshift.c b/src/redshift.c index 818db4e..8fb2ddf 100644 --- a/src/redshift.c +++ b/src/redshift.c @@ -338,15 +338,15 @@ print_period(double elevation) } /* Interpolate value based on the specified solar elevation. */ -static float -calculate_interpolated_value(double elevation, float day, float night) +static double +calculate_interpolated_value(double elevation, double day, double night) { - float result; + double result; if (elevation < transition_low) { result = night; } else if (elevation < transition_high) { /* Transition period: interpolate */ - float a = (transition_low - elevation) / + double a = (transition_low - elevation) / (transition_low - transition_high); result = (1.0-a)*night + a*day; } else { -- cgit v1.2.3-70-g09d2