I want to store WGS84-coordinates in two integers for latitude and longitude instead of floats to get a higher precision than with floats.Here's my code:struct Coordinate{    private int latitude;    private int longitude;    const double latMin = -90.0f;    const double latMax = 90.0f;    const double lngMin = -180.0f;    const double lngMax = 180.0f;    public Coordinate(double latitude, double longitude)    {        this.latitude = mapDoubleToInt(latitude, latMin, latMax);        this.longitude = mapDoubleToInt(longitude, lngMin, lngMax);    }    public double Latitude { get { return mapIntToDouble(latitude, latMin, latMax); } }    public double Longitude { get { return mapIntToDouble(longitude, lngMin, lngMax); } }    private static int mapDoubleToInt(double value, double min, double max)    {        return (int)(((long)int.MaxValue - int.MinValue) * (value - min) / (max - min) + int.MinValue);    }    private static double mapIntToDouble(int value, double min, double max)    {        return ((double)value - int.MinValue) / ((long)int.MaxValue - int.MinValue) * (max - min) + min;    }   }I'm not sure if there is a better to convert the data. There are a lot of casts and arithmetic operations in it -- any way to do this more elegantly?
WGS84-coordinate encoded as Integers
c#;integer;coordinate system;floating point;casting