1# ticket: 400 2 3cimport cython 4 5 6@cython.test_fail_if_path_exists("//SingleAssignmentNode//TypecastNode") 7@cython.test_assert_path_exists( 8 "//PythonCapiCallNode", 9 "//PythonCapiCallNode/PythonCapiFunctionNode/@cname = '__Pyx_truncl'", 10) 11def long_double_to_float_int(long double x): 12 """ 13 >>> long_double_to_float_int(4.1) 14 4.0 15 >>> long_double_to_float_int(-4.1) 16 -4.0 17 >>> long_double_to_float_int(4) 18 4.0 19 """ 20 cdef float r = int(x) 21 return r 22