Fixed zodiac calculation in GsweMoment

Yielded GSWE_SIGN_NONE instead of GSWE_SIGN_ARIES at position 0.0
This commit is contained in:
Gergely Polonkai 2013-09-17 09:43:10 +02:00
parent 115f28a6ef
commit 46a59fedf6
3 changed files with 7 additions and 1 deletions

View File

@ -1,6 +1,6 @@
m4_define([swe_glib_major_version], [1])
m4_define([swe_glib_minor_version], [0])
m4_define([swe_glib_micro_version], [1])
m4_define([swe_glib_micro_version], [2])
m4_define([swe_glib_version], [swe_glib_major_version.swe_glib_minor_version.swe_glib_micro_version])
m4_define([swe_glib_api_version], [swe_glib_major_version.0])

View File

@ -476,6 +476,12 @@ gswe_calculate_data_by_position(GsweMoment *moment, GswePlanet planet, gdouble p
sign = (GsweZodiac)ceil(position / 30.0);
// If position happens to be exactly 0, this calculation yields
// GSWE_SIGN_NONE, but should be GSWE_SIGN_ARIES
if (sign == 0) {
sign = 1;
}
if ((sign_info = g_hash_table_lookup(gswe_sign_info_table, GINT_TO_POINTER(sign))) == NULL) {
g_error("Calculations brought an unknown sign!");
}