@@ -1076,17 +1076,20 @@ math_2(PyObject *const *args, Py_ssize_t nargs,
10761076 }\
10771077 PyDoc_STRVAR(math_##funcname##_doc, docstring);
10781078
1079- FUNC1 (acos , acos , 0 ,
1079+ FUNC1D (acos , acos , 0 ,
10801080 "acos($module, x, /)\n--\n\n"
10811081 "Return the arc cosine (measured in radians) of x.\n\n"
1082- "The result is between 0 and pi." )
1083- FUNC1 (acosh , acosh , 0 ,
1082+ "The result is between 0 and pi." ,
1083+ "expected a number in range from -1 up to 1, got %s" )
1084+ FUNC1D (acosh , acosh , 0 ,
10841085 "acosh($module, x, /)\n--\n\n"
1085- "Return the inverse hyperbolic cosine of x." )
1086- FUNC1 (asin , asin , 0 ,
1086+ "Return the inverse hyperbolic cosine of x." ,
1087+ "expected argument value not less than 1, got %s" )
1088+ FUNC1D (asin , asin , 0 ,
10871089 "asin($module, x, /)\n--\n\n"
10881090 "Return the arc sine (measured in radians) of x.\n\n"
1089- "The result is between -pi/2 and pi/2." )
1091+ "The result is between -pi/2 and pi/2." ,
1092+ "expected a number in range from -1 up to 1, got %s" )
10901093FUNC1 (asinh , asinh , 0 ,
10911094 "asinh($module, x, /)\n--\n\n"
10921095 "Return the inverse hyperbolic sine of x." )
@@ -1147,9 +1150,10 @@ FUNC2(copysign, copysign,
11471150 "Return a float with the magnitude (absolute value) of x but the sign of y.\n\n"
11481151 "On platforms that support signed zeros, copysign(1.0, -0.0)\n"
11491152 "returns -1.0.\n" )
1150- FUNC1 (cos , cos , 0 ,
1153+ FUNC1D (cos , cos , 0 ,
11511154 "cos($module, x, /)\n--\n\n"
1152- "Return the cosine of x (measured in radians)." )
1155+ "Return the cosine of x (measured in radians)." ,
1156+ "expected a finite input, got %s" )
11531157FUNC1 (cosh , cosh , 1 ,
11541158 "cosh($module, x, /)\n--\n\n"
11551159 "Return the hyperbolic cosine of x." )
@@ -1213,33 +1217,37 @@ math_floor(PyObject *module, PyObject *number)
12131217FUNC1AD (gamma , m_tgamma ,
12141218 "gamma($module, x, /)\n--\n\n"
12151219 "Gamma function at x." ,
1216- "expected a float or nonnegative integer, got %s" )
1217- FUNC1A (lgamma , m_lgamma ,
1220+ "expected a noninteger or positive integer, got %s" )
1221+ FUNC1AD (lgamma , m_lgamma ,
12181222 "lgamma($module, x, /)\n--\n\n"
1219- "Natural logarithm of absolute value of Gamma function at x." )
1220- FUNC1 (log1p , m_log1p , 0 ,
1223+ "Natural logarithm of absolute value of Gamma function at x." ,
1224+ "expected a noninteger or positive integer, got %s" )
1225+ FUNC1D (log1p , m_log1p , 0 ,
12211226 "log1p($module, x, /)\n--\n\n"
12221227 "Return the natural logarithm of 1+x (base e).\n\n"
1223- "The result is computed in a way which is accurate for x near zero." )
1228+ "The result is computed in a way which is accurate for x near zero." ,
1229+ "expected argument value > -1, got %s" )
12241230FUNC2 (remainder , m_remainder ,
12251231 "remainder($module, x, y, /)\n--\n\n"
12261232 "Difference between x and the closest integer multiple of y.\n\n"
12271233 "Return x - n*y where n*y is the closest integer multiple of y.\n"
12281234 "In the case where x is exactly halfway between two multiples of\n"
12291235 "y, the nearest even value of n is used. The result is always exact." )
1230- FUNC1 (sin , sin , 0 ,
1236+ FUNC1D (sin , sin , 0 ,
12311237 "sin($module, x, /)\n--\n\n"
1232- "Return the sine of x (measured in radians)." )
1238+ "Return the sine of x (measured in radians)." ,
1239+ "expected a finite input, got %s" )
12331240FUNC1 (sinh , sinh , 1 ,
12341241 "sinh($module, x, /)\n--\n\n"
12351242 "Return the hyperbolic sine of x." )
12361243FUNC1D (sqrt , sqrt , 0 ,
12371244 "sqrt($module, x, /)\n--\n\n"
12381245 "Return the square root of x." ,
12391246 "expected a nonnegative input, got %s" )
1240- FUNC1 (tan , tan , 0 ,
1247+ FUNC1D (tan , tan , 0 ,
12411248 "tan($module, x, /)\n--\n\n"
1242- "Return the tangent of x (measured in radians)." )
1249+ "Return the tangent of x (measured in radians)." ,
1250+ "expected a finite input, got %s" )
12431251FUNC1 (tanh , tanh , 0 ,
12441252 "tanh($module, x, /)\n--\n\n"
12451253 "Return the hyperbolic tangent of x." )
0 commit comments