Commit f4d5dec3 authored by Dean Scarff's avatar Dean Scarff Committed by scoder

Add test for libc.math's modf

Test modf, since it's in C89 and has a non-trivial signature.
parent b45c8e9e
......@@ -2,8 +2,8 @@
from libc.math cimport (M_E, M_LOG2E, M_LOG10E, M_LN2, M_LN10, M_PI, M_PI_2,
M_PI_4, M_1_PI, M_2_PI, M_2_SQRTPI, M_SQRT2, M_SQRT1_2)
from libc.math cimport (acos, asin, atan, atan2, cos, sin, sinf, sinl, tan,
cosh, sinh, tanh, acosh, asinh, atanh, exp, log, log10, pow, sqrt)
from libc.math cimport (acos, asin, atan, atan2, cos, modf, sin, sinf, sinl,
tan, cosh, sinh, tanh, acosh, asinh, atanh, exp, log, log10, pow, sqrt)
cimport libc.math as libc_math
......@@ -42,3 +42,13 @@ def test_sin_kwarg(x):
0.0
"""
return sin(x=x)
def test_modf(x):
"""
>>> test_modf(2.5)
(0.5, 2.0)
"""
cdef double i
cdef double f = modf(x, &i)
return (f, i)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment