[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdeedu/kstars/kstars
From: Pablo de Vicente <p.devicente () wanadoo ! es>
Date: 2003-12-24 17:14:29
[Download RAW message or body]
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@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) {
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic