From 68ec9577bb07f70e9aa75a52004a46370abffeef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?= <grubba@grubba.org> Date: Thu, 8 Oct 2015 16:44:23 +0200 Subject: [PATCH] Documentation [%]: Added some clarifications and improved markup. Fixes [LysLysKOM 21477516] reported by Per Cederqvist. Thanks. --- src/operators.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/operators.c b/src/operators.c index 99e33652ea..0b5af5deeb 100644 --- a/src/operators.c +++ b/src/operators.c @@ -4348,22 +4348,26 @@ do_lfun_modulo: *! For numbers, this means that *! @ol *! @item - *! a % b always has the same sign as b (typically b is positive; - *! array size, rsa modulo, etc, and a varies a lot more than b). + *! @expr{a % b@} always has the same sign as @expr{b@} + *! (typically @expr{b@} is positive; + *! array size, rsa modulo, etc, and @expr{a@} varies a + *! lot more than @expr{b@}). *! @item - *! The function f(x) = x % n behaves in a sane way; as x increases, - *! f(x) cycles through the values 0,1, ..., n-1, 0, .... Nothing + *! The function @expr{f(x) = x % n@} behaves in a sane way; + *! as @expr{x@} increases, @expr{f(x)@} cycles through the + *! values @expr{0,1, ..., n-1, 0, ...@}. Nothing *! strange happens when you cross zero. *! @item - *! The % operator implements the binary "mod" operation, as defined - *! by Donald Knuth (see the Art of Computer Programming, 1.2.4). It - *! should be noted that Pike treats %-by-0 as an error rather than - *! returning 0, though. + *! The @expr{%@} operator implements the binary "mod" operation, + *! as defined by Donald Knuth (see the Art of Computer Programming, + *! 1.2.4). It should be noted that Pike treats %-by-0 as an error + *! rather than returning 0, though. *! @item - *! / and % are compatible, so that a = b*(a/b) + a%b for all a and b. + *! @expr{/@} and @expr{%@} are compatible, so that + *! @expr{a == b*@[floor](a/b) + a%b@} for all @expr{a@} and @expr{b@}. *! @endol *! @seealso - *! @[`/] + *! @[`/], @[floor()] */ PMOD_EXPORT void f_mod(INT32 args) { -- GitLab