mirror of
https://github.com/opentx/opentx.git
synced 2025-07-15 12:25:12 +03:00
Closes #4560: Lua uses double
(again) for numbers. The float
usage was not good for bit32 library where only ~24bits (out of 32) were correct, others were lost. This is supposed to be a temporary solution.
This commit is contained in:
parent
6c493fddd9
commit
acfeb7b47a
2 changed files with 11 additions and 11 deletions
|
@ -153,10 +153,10 @@ static void luaPushLatLon(lua_State* L, TelemetrySensor & telemetrySensor, Telem
|
|||
/* result is lua table containing members ["lat"] and ["lon"] as lua_Number (doubles) in decimal degrees */
|
||||
{
|
||||
lua_createtable(L, 0, 4);
|
||||
lua_pushtablenumber(L, "lat", telemetryItem.gps.latitude * 0.000001f); // floating point multiplication is faster than division
|
||||
lua_pushtablenumber(L, "pilot-lat", telemetryItem.pilotLatitude * 0.000001f);
|
||||
lua_pushtablenumber(L, "lon", telemetryItem.gps.longitude * 0.000001f);
|
||||
lua_pushtablenumber(L, "pilot-lon", telemetryItem.pilotLongitude * 0.000001f);
|
||||
lua_pushtablenumber(L, "lat", telemetryItem.gps.latitude * 0.000001); // floating point multiplication is faster than division
|
||||
lua_pushtablenumber(L, "pilot-lat", telemetryItem.pilotLatitude * 0.000001);
|
||||
lua_pushtablenumber(L, "lon", telemetryItem.gps.longitude * 0.000001);
|
||||
lua_pushtablenumber(L, "pilot-lon", telemetryItem.pilotLongitude * 0.000001);
|
||||
}
|
||||
|
||||
static void luaPushTelemetryDateTime(lua_State* L, TelemetrySensor & telemetrySensor, TelemetryItem & telemetryItem)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue