summaryrefslogtreecommitdiff
path: root/tests/run/cpp_stl_cmath_cpp20.pyx
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run/cpp_stl_cmath_cpp20.pyx')
-rw-r--r--tests/run/cpp_stl_cmath_cpp20.pyx13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/run/cpp_stl_cmath_cpp20.pyx b/tests/run/cpp_stl_cmath_cpp20.pyx
new file mode 100644
index 000000000..0d4f5af93
--- /dev/null
+++ b/tests/run/cpp_stl_cmath_cpp20.pyx
@@ -0,0 +1,13 @@
+# mode: run
+# tag: cpp, werror, cpp20
+
+from libcpp.cmath cimport lerp
+
+def test_lerp(double a, double b, double t):
+ """ Test C++20 std::lerp function
+ >>> test_lerp(1.0, 2.0, 0.5)
+ 1.5
+ >>> test_lerp(1.0, 4.0, 0.5)
+ 2.5
+ """
+ return lerp(a, b, t)