Subject: [Geopriv] question regarding example in draft-thomson-geopriv-3825bis-00.txt

From: Klaus Darilion <[email-masked]>
Date: Mon, 23 Apr 2007 14:33:51 +0200

Hi!

I can't follow the example in the draft. The problem arises when 
converting the latitude/longitude/altitude from float into fixpoint integer.

For lat/long the conversion can be done by:
lat_fp = lat_float * (2^25)

The question is here: What to do with the numbers behind the coma. Just 
truncate or round?

In the example, the latitude is: -33.8570095
Multiplied by 2^25 (33554432) this is: -1136052722,991104

truncated conversion:
-1136052722 = 1110111100010010010011011000001110
rounded conversion:
-1136052723 = 1110111100010010010011011000001101

compared with the result in the draft it looks like the example 
truncates the converted value. But:

In the example, the longitude is: 151.2152005
Multiplied by 2^25 (33554432) this is: 5073940162,543616

truncated conversion:
5073940162 = 0100101110011011100010111011000010
rounded conversion:
5073940163 = 0100101110011011100010111011000011

compared with the result in the draft it looks like the example rounds 
the converted value.

Thus, the example in the draft truncates during the conversion for 
latitude, but rounds for longitude. Or is it a ceil()?

Thus, I suggest the draft should also contain some guidance how to 
convert (truncate or round) to get same results from different 
implementation.

regards
klaus

_______________________________________________
Geopriv mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/geopriv