Skip to content

Commit

Permalink
tests: math: interpolation: disable floating point contraction
Browse files Browse the repository at this point in the history
This test cannot tolerate any loss of precision, including the one
caused by the compiler contracting floating points operations together,
like in fused multiply-add (FMA). Some toolchains enable FP contraction
by default, so disable it for the specific test and let the user decide
themselves whether precision or performance is needed for their
specific application.

Signed-off-by: Ilya Tagunov <[email protected]>
  • Loading branch information
tagunil committed Nov 20, 2024
1 parent 2f800ce commit 1feb2b8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/lib/math/interpolation/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include <math.h>

#include <zephyr/ztest.h>

#pragma STDC FP_CONTRACT OFF
#include <zephyr/math/interpolation.h>

ZTEST(interpolation, test_interpolation_oob)
Expand Down

0 comments on commit 1feb2b8

Please sign in to comment.