diff Modules/mathmodule.c @ 12663:1ea8cf885f7b legacy-trunk

Added math.rint() -- round according to current IEEE754 mode
author Guido van Rossum <guido@python.org>
date Thu, 11 May 2000 18:19:42 +0000
parents cc4350b1b91f
children 2a6dc65c060f
line wrap: on
line diff
--- a/Modules/mathmodule.c	Thu May 11 14:43:52 2000 +0000
+++ b/Modules/mathmodule.c	Thu May 11 18:19:42 2000 +0000
@@ -156,6 +156,8 @@
 FUNC2(math_pow, pow, math_pow_doc,
       "pow(x,y)\n\nReturn x**y.")
 #endif
+FUNC1(math_rint, rint, math_rint_doc,
+      "rint(x)\n\nReturn the integer nearest to x as a real.")
 FUNC1(math_sin, sin, math_sin_doc,
       "sin(x)\n\nReturn the sine of x.")
 FUNC1(math_sinh, sinh, math_sinh_doc,
@@ -267,6 +269,7 @@
 	{"log10",	math_log10,	0,	math_log10_doc},
 	{"modf",	math_modf,	0,	math_modf_doc},
 	{"pow",		math_pow,	0,	math_pow_doc},
+	{"rint",	math_rint,	0,	math_rint_doc},
 	{"sin",		math_sin,	0,	math_sin_doc},
 	{"sinh",	math_sinh,	0,	math_sinh_doc},
 	{"sqrt",	math_sqrt,	0,	math_sqrt_doc},