> if (deg > 99 || deg < -99)
> sprintf(res, "%c**%c%02d%c%0*.*f",
> (deg < 0 ? '-' : '+'), sep, min, sep,
> (ndp ? ndp + 3 : 2), ndp, ndp, secs);
> else
> sprintf(res, "%+02d%c%02d%c%0*.*f",
> deg, sep, min, sep, ndp ? ndp + 3 : 2, ndp, secs);
The most noteworthy thing about this piece of code is that it has the
MINUS ZERO BUG. An angle of -00 01 02 will be rendered as "+ 0 1 2".
Apart from that, I imagine the first clause is supposed to be:
sprintf(res, "%c**%c%02d%c%0*.*f",
(deg < 0 ? '-' : '+'),
sep, min, sep, ndp ? ndp + 3 : 2, ndp, secs);
Patrick Wallace
____________________________________________________________________________
Starlink/HMNAO Internet: [log in to unmask]
Rutherford Appleton Laboratory Tel: +44-1235-445372
Chilton, Didcot, Fax: +44-1235-446362
Oxon OX11 0QX, UK
____________________________________________________________________________
|