From b7e6dc3d05a467e7a7300f03c2e9299fd3e7d80d Mon Sep 17 00:00:00 2001 From: Lauri Peltonen Date: Fri, 13 Sep 2019 21:36:43 +0300 Subject: [PATCH] Fixed code example which utilizes non-existing function 'abs' - the value is stated to be negative so abs(a) is the same as -a --- docs/types/value-types.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/types/value-types.rst b/docs/types/value-types.rst index 0b9d6ad90..053160701 100644 --- a/docs/types/value-types.rst +++ b/docs/types/value-types.rst @@ -110,7 +110,7 @@ Modulo The modulo operation ``a % n`` yields the remainder ``r`` after the division of the operand ``a`` by the operand ``n``, where ``q = int(a / n)`` and ``r = a - (n * q)``. This means that modulo -results in the same sign as its left operand (or zero) and ``a % n == -(abs(a) % n)`` holds for negative ``a``: +results in the same sign as its left operand (or zero) and ``a % n == -(-a % n)`` holds for negative ``a``: * ``int256(5) % int256(2) == int256(1)`` * ``int256(5) % int256(-2) == int256(1)``