From 3f7edd3218403f202047402494c752c1ce6c5ec2 Mon Sep 17 00:00:00 2001 From: Fabian R Lischka Date: Mon, 18 Nov 2013 11:33:28 -0500 Subject: [PATCH] added modpi etc. documentation. Updated the example for round() using non-ten basis --- doc/stdlib/base.rst | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/doc/stdlib/base.rst b/doc/stdlib/base.rst index 38ffce7d0e6fa..c83a326362d82 100644 --- a/doc/stdlib/base.rst +++ b/doc/stdlib/base.rst @@ -1972,6 +1972,18 @@ Mathematical Operators Modulus after division, returning in the range [0,m) +.. function:: modpi(x) + + Modulus after division by pi, returning in the range [0,pi). More accurate than mod(x,pi). + +.. function:: mod2pi(x) + + Modulus after division by 2pi, returning in the range [0,2pi). More accurate than mod(x,2pi). + +.. function:: modpio2(x) + + Modulus after division by pi/2, returning in the range [0,pi/2). More accurate than mod(x,pi/2). + .. function:: rem(x, m) Remainder after division @@ -2468,7 +2480,7 @@ Mathematical Functions .. function:: round(x, [digits, [base]]) - ``round(x)`` returns the nearest integral value of the same type as ``x`` to ``x``. ``round(x, digits)`` rounds to the specified number of digits after the decimal place, or before if negative, e.g., ``round(pi,2)`` is ``3.14``. ``round(x, digits, base)`` rounds using a different base, defaulting to 10, e.g., ``round(pi, 3, 2)`` is ``3.125``. + ``round(x)`` returns the nearest integral value of the same type as ``x`` to ``x``. ``round(x, digits)`` rounds to the specified number of digits after the decimal place, or before if negative, e.g., ``round(pi,2)`` is ``3.14``. ``round(x, digits, base)`` rounds using a different base, defaulting to 10, e.g., ``round(pi, 1, 8)`` is ``3.125``. .. function:: ceil(x, [digits, [base]])