gh-126719: Clarify math.fmod docs (#127741)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
This commit is contained in:
Stan Ulbrych 2025-01-04 17:38:57 +00:00 committed by GitHub
parent fd94c6a803
commit f28d471fbe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -248,7 +248,8 @@ Floating point arithmetic
.. function:: fmod(x, y) .. function:: fmod(x, y)
Return ``fmod(x, y)``, as defined by the platform C library. Note that the Return the floating-point remainder of ``x / y``,
as defined by the platform C library function ``fmod(x, y)``. Note that the
Python expression ``x % y`` may not return the same result. The intent of the C Python expression ``x % y`` may not return the same result. The intent of the C
standard is that ``fmod(x, y)`` be exactly (mathematically; to infinite standard is that ``fmod(x, y)`` be exactly (mathematically; to infinite
precision) equal to ``x - n*y`` for some integer *n* such that the result has precision) equal to ``x - n*y`` for some integer *n* such that the result has