On Tue, 2010-08-24 at 17:50 +0530, Arulalan T wrote:
> 
> This gives the what I need.
> But I can not use this Decimal data type.
> 
> I am doing project for Indian Meteorological Department using CDAT python
> library.
> 
> Now I am plotting weather symbol markers on India Map at corresponding
> latitude and longitude (in float) dynamically.
> Due to inaccuracy floating value of latitude & logitude,
> the position of markers are moved away from the exact position of the
> stations on the map in vcs.
> 
> so I need float value in 2 precision without changing the value. Not in
> string. Not in Decimal.
> 
> In CDAT vcs module supports only the 'float data' type to represent the
> latitude & logitude in map.
> 
> Any suggestions?

Firstly, if you're using it for this purpose then you needn't worry at
all. A difference in longitude from 80.23° to 80.230000000000004° is a
difference in terms of surface distance of a few nanometres at most.
Hardly a problem for weather.

Secondly and more importantly, you're asking for the impossible. The
floating point data type can only represent a fraction of all rational
numbers accurately. This is not a limitation of the language you're
choosing, it is a limitation of the format.

-- 
Roshan George

_______________________________________________
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc

Reply via email to