[Kstars-devel] kdeedu/kstars/kstars

Pablo de Vicente p.devicente at wanadoo.es
Wed Dec 24 18:14:29 CET 2003


CVS commit by pvicente: 

Fixed a subtle bug when converting from a QString to a dms object.
The bug appeared when integer degrees were cero, integer minutes were 
negative and seconds were not null. For example: "00 -02 30" was considered 
to be "-2+30/60.", whereas it should be "-2-30/60." However "00 00 -30" was
computed correctly. 

The criteria now is, if any of the fields "dd" or "mm" or "ss" is negative 
the angle is considered to be negative.

CCMAIL: kstars-devel at kde.org


  M +4 -3      dms.cpp   1.25


--- kdeedu/kstars/kstars/dms.cpp  #1.24:1.25
@@ -149,7 +149,8 @@ bool dms::setFromString( const QString &
 
         if ( !badEntry ) {
-                double D = (double)abs(d) + (double)m/60.
-                                + (double)s/3600.;
-                if ( d <0 ) {D = -1.0*D;}
+                double D = (double)abs(d) + (double)abs(m)/60.
+                                + (double)fabs(s)/3600.;
+
+                if ( d<0 || m < 0 || s<0 ) { D = -1.0*D;}
 
                 if (isDeg) {




More information about the Kstars-devel mailing list