diff options
author | rbuj <[email protected]> | 2020-02-04 11:56:23 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2020-03-12 15:04:14 +0100 |
commit | 10fe037ccc55de08f3355a4b36f974cbd2d59b92 (patch) | |
tree | 1e1e2452a7d2da8a8a72b10ba3ca22f8ca6ddd0c /libmateweather/weather-priv.h | |
parent | e0285e866f1c57615a9cd2df17b7d19d6825ddc0 (diff) | |
download | libmateweather-10fe037ccc55de08f3355a4b36f974cbd2d59b92.tar.bz2 libmateweather-10fe037ccc55de08f3355a4b36f974cbd2d59b92.tar.xz |
weather: use round for rounding floats
Diffstat (limited to 'libmateweather/weather-priv.h')
-rw-r--r-- | libmateweather/weather-priv.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libmateweather/weather-priv.h b/libmateweather/weather-priv.h index c0c0944..08c828e 100644 --- a/libmateweather/weather-priv.h +++ b/libmateweather/weather-priv.h @@ -122,9 +122,9 @@ const gchar * weather_conditions_string (WeatherConditions cond); /* Units conversions and names */ -#define TEMP_F_TO_C(f) (((f) - 32.0) * 0.555556) -#define TEMP_F_TO_K(f) (TEMP_F_TO_C (f) + 273.15) -#define TEMP_C_TO_F(c) (((c) * 1.8) + 32.0) +#define TEMP_F_TO_C(f) (((f) - 32.0) * (5.0/9.0)) +#define TEMP_F_TO_K(f) ((f + 459.67) * (5.0/9.0)) +#define TEMP_C_TO_F(c) (((c) * (9.0/5.0)) + 32.0) #define WINDSPEED_KNOTS_TO_KPH(knots) ((knots) * 1.851965) #define WINDSPEED_KNOTS_TO_MPH(knots) ((knots) * 1.150779) |