You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@rmackay9 I would like to work on this issue. But I have one question, if we simply do to divide _interim_state.current_amps * dt by 3600000 we should surely get more accurate results than multiplying by 0.0000002778f but we know that divisions are much costlier than multiplication. So should I compromise cost for accuracy?
@shiv-tyagi I wouldn't expect any difference in accuracy but maybe I'm misunderstanding something. In general we should go for accuracy though. By the way, when it comes to testing it would be good to check various values to ensure the calculations are the same before and after the change.
As pointed out by @WickedShell when reviewing PR #19404 we probably don't need to cast to double in lines like below in AP_BattMonitor_UAVCAN.cpp.
float mah = (float) ((double) _interim_state.current_amps * (double) dt * (double) 0.0000002778f);
We should remove the doubles and make sure the accuracy of the output is not reduced.
The text was updated successfully, but these errors were encountered: