junzis / pyModeS

Python decoder for Mode S and ADS-B signals
GNU General Public License v3.0
527 stars 151 forks source link

Latitude/Longitude return values too small #81

Closed christiankast closed 3 years ago

christiankast commented 3 years ago

Hello, just a simple question: "cprlat_even = util.bin2int(msgbin0[54:71]) / 131072.0" is returning a value which is sometimes too small because bin2int is returning an 16 bit integer. CPR information is 17 bit and can't be returned as integer. In my opinion the return value must be a long value or is there something I do not understand? Cheers Christian

junzis commented 3 years ago

The return of an integer is only in Python 2. In Python 3, this will return a float.