-
Notifications
You must be signed in to change notification settings - Fork 17k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make testing equivalence of floats in SITL a compilation error #9196
Conversation
3978a7a
to
f1a4863
Compare
The last patch here has me a little dubious; should we really be using an epsilon? Perhaps we should instead pragma-off the compiler error for test_math.cpp? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will break xplane
libraries/SITL/SIM_XPlane.cpp
Outdated
@@ -241,7 +241,7 @@ bool XPlane::receive_data(void) | |||
*/ | |||
bool has_magic = ((uint32_t)(data[1] * throttle_magic_scale) % 1000U) == (uint32_t)(throttle_magic * throttle_magic_scale); | |||
if (data[1] < 0 || | |||
data[1] == throttle_sent || | |||
is_equal(data[1], throttle_sent) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, this really, really needs to be ==, a epsilon will break this
f1a4863
to
e9bbcc5
Compare
pramga'd the -Werror away instead.
e9bbcc5
to
f87b828
Compare
Assigned devcalltopic in case somebody on the call knows the tests should be strict-equivalence. |
There are legitimate reasons for doing direct equivalence in these files
f87b828
to
2989c01
Compare
It was decided on the devcall that the math tests should be allowed to directly compare floats for equivalence, on the basis that they should know what they're doing. Removed old changes, pragma'd away the |
No description provided.