模除 (Chinese Wikipedia)

Analysis of information sources in references of the Wikipedia article "模除" in Chinese language version.

refsWebsite
Global rank Chinese rank
low place
low place
629th place
556th place
67th place
154th place
153rd place
238th place
1st place
1st place
low place
low place
low place
low place
low place
low place
low place
low place
6th place
4th place
9,657th place
6,478th place
low place
low place
low place
low place
low place
low place
4,194th place
6,048th place
916th place
1,065th place
low place
low place
2,158th place
3,777th place
low place
low place
1,185th place
809th place
2nd place
23rd place
4,221st place
2,953rd place
low place
low place
low place
low place
low place
low place
low place
low place
low place
low place
low place
low place
low place
low place
7,871st place
6,207th place
low place
8,973rd place
low place
low place
3,671st place
3,893rd place
691st place
943rd place
low place
low place
low place
low place

acm.org

portal.acm.org

  • Boute, Raymond T. The Euclidean definition of the functions div and mod. ACM Transactions on Programming Languages and Systems (ACM Press (New York, NY, USA)). April 1992, 14 (2): 127–144. doi:10.1145/128861.128862 (英语). 
    Let us recall Euclid’s theorem.
    THEOREM. For any real numbers and with , there exists a unique pair of numbers satisfying the following conditions:
    (a) ;
    (b) ;
    (c) .
    For the particular case of integers, the conditions (a)-(c) correspond to part of the axioms for Euclidean rings [9].
    With the notational conventions of the theorem, we define and . Clearly the correspondingly labeled conditions are satisfied.
    Properties

    where and is as defined earlier. ()

apple.com

developer.apple.com

archive.org

clojure.github.io

coding-guidelines.com

  • Jones, Derek M. The New C Standard: An Economic and Cultural Commentary (PDF). Addison-Wesley. 2003 [2018-07-11]. ISBN 9780201709179. (原始内容 (PDF)存档于2018-07-11) (英语). 
    C99 reflects almost universal processor behavior (as does the Fortran Standard). This definition truncates toward zero and the expression (-(a/b) == (-a)/b) && (-(a/b) == a/(-b)) is always true. It also means that the absolute value of the result does not depend on the signs of the operands; for example:
    +10 / +3 == +3 +10 % +3 == +1 -10 / +3 == -3 -10 % +3 == -1
    +10 / -3 == -3 +10 % -3 == +1 -10 / -3 == +3 -10 % -3 == -1
    C90
    When integers are divided and the division is inexact, if both operands are positive the result of the / operator is the largest integer less than the algebraic quotient and the result of the % operator is positive. If either operand is negative, whether the result of the / operator is the largest integer less than or equal to the algebraic quotient or the smallest integer greater than or equal to the algebraic quotient is implementation-defined, as is the sign of the result of the % operator.
    If either operand is negative, the behavior may differ between C90 and C99, depending on the implementation-defined behavior of the C90 implementation.
    #include <stdio.h>
    
    int main(void)
    {
    int x = -1,
    y = +3;
    if ((x%y > 0) ||
        ((x+y)%y == x%y))
        printf("This is a C90 translator behaving differently than C99\n");
    }
    
    Quoting from the C9X Revision Proposal, WG14/N613, that proposed this change:
    The origin of this practice seems to have been a desire to map C’s division directly to the “natural” behavior of the target instruction set, whatever it may be, without requiring extra code overhead that might be necessary to check for special cases and enforce a particular behavior. However, the argument that Fortran programmers are unpleasantly surprised by this aspect of C and that there would be negligible impact on code efficiency was accepted by WG14, who agreed to require Fortran-like behavior in C99.

coffeescript.org

dart.dev

api.dart.dev

dlang.org

doi.org

  • Boute, Raymond T. The Euclidean definition of the functions div and mod. ACM Transactions on Programming Languages and Systems (ACM Press (New York, NY, USA)). April 1992, 14 (2): 127–144. doi:10.1145/128861.128862 (英语). 
    Let us recall Euclid’s theorem.
    THEOREM. For any real numbers and with , there exists a unique pair of numbers satisfying the following conditions:
    (a) ;
    (b) ;
    (c) .
    For the particular case of integers, the conditions (a)-(c) correspond to part of the axioms for Euclidean rings [9].
    With the notational conventions of the theorem, we define and . Clearly the correspondingly labeled conditions are satisfied.
    Properties

    where and is as defined earlier. ()

elm-lang.org

package.elm-lang.org

erlang.org

go.dev

pkg.go.dev

go.dev

hansotten.com

pascal.hansotten.com

  • ISO/IEC 7185, Information Technology—Programming Languages–Pascal. International Standard, 2nd ed. (PDF). ISO/IEC 7185, 1990 (E). 
    A term of the form i div j shall be an error if j is zero; otherwise, the value of i div j shall be such that
    abs(i) - abs(j) < abs((i div j) * j) <= abs(i)
    where the value shall be zero if abs(i) < abs(j); otherwise, the sign of the value shall be positive if i and j have the same sign and negative if i and j have different signs.
    A term of the form i mod j shall be an error if j is zero or negative; otherwise, the value of i mod j shall be that value of (i - (k * j)) for integral k such that 0 <= i mod j < j.
    NOTE 2 — Only for i >= 0 and j > 0 does the relation (i div j) * j + i mod j = i hold.
    Kathleen Jensen, Niklaus Wirth. PASCAL User Manual and Report - ISO Pascal Standard (PDF). 1991. 
    div   divide and truncate (i.e., value is not rounded)
    mod   modulus: let Remainder = A - (A div B) * B;
      if Remainder < 0 then A mod B = Remainder + B

      otherwise A mod B = Remainder

haskell.org

hexdocs.pm

iso.org

julialang.org

docs.julialang.org

khronos.org

kotlinlang.org

microsoft.com

docs.microsoft.com

  • Operators. Microsoft. [2021-07-19]. The % operator is defined only in cases where either both sides are positive or both sides are negative. Unlike C, it also operates on floating-point data types, as well as integers. 
  • QuantumWriter. Expressions. docs.microsoft.com. [2018-07-11] (美国英语). 

learn.microsoft.com

nasm.us

ocaml.org

open-std.org

opengroup.org

pubs.opengroup.org

perl.org

perldoc.perl.org

php.net

purescript.org

pursuit.purescript.org

r-project.org

search.r-project.org

r6rs.org

rust-lang.org

doc.rust-lang.org

teamleadnet.com

blog.teamleadnet.com

utexas.edu

cs.utexas.edu

  • ISO/IEC 7185, Information Technology—Programming Languages–Pascal. International Standard, 2nd ed. (PDF). ISO/IEC 7185, 1990 (E). 
    A term of the form i div j shall be an error if j is zero; otherwise, the value of i div j shall be such that
    abs(i) - abs(j) < abs((i div j) * j) <= abs(i)
    where the value shall be zero if abs(i) < abs(j); otherwise, the sign of the value shall be positive if i and j have the same sign and negative if i and j have different signs.
    A term of the form i mod j shall be an error if j is zero or negative; otherwise, the value of i mod j shall be that value of (i - (k * j)) for integral k such that 0 <= i mod j < j.
    NOTE 2 — Only for i >= 0 and j > 0 does the relation (i div j) * j + i mod j = i hold.
    Kathleen Jensen, Niklaus Wirth. PASCAL User Manual and Report - ISO Pascal Standard (PDF). 1991. 
    div   divide and truncate (i.e., value is not rounded)
    mod   modulus: let Remainder = A - (A div B) * B;
      if Remainder < 0 then A mod B = Remainder + B

      otherwise A mod B = Remainder

w3.org

web.archive.org

  • Jones, Derek M. The New C Standard: An Economic and Cultural Commentary (PDF). Addison-Wesley. 2003 [2018-07-11]. ISBN 9780201709179. (原始内容 (PDF)存档于2018-07-11) (英语). 
    C99 reflects almost universal processor behavior (as does the Fortran Standard). This definition truncates toward zero and the expression (-(a/b) == (-a)/b) && (-(a/b) == a/(-b)) is always true. It also means that the absolute value of the result does not depend on the signs of the operands; for example:
    +10 / +3 == +3 +10 % +3 == +1 -10 / +3 == -3 -10 % +3 == -1
    +10 / -3 == -3 +10 % -3 == +1 -10 / -3 == +3 -10 % -3 == -1
    C90
    When integers are divided and the division is inexact, if both operands are positive the result of the / operator is the largest integer less than the algebraic quotient and the result of the % operator is positive. If either operand is negative, whether the result of the / operator is the largest integer less than or equal to the algebraic quotient or the smallest integer greater than or equal to the algebraic quotient is implementation-defined, as is the sign of the result of the % operator.
    If either operand is negative, the behavior may differ between C90 and C99, depending on the implementation-defined behavior of the C90 implementation.
    #include <stdio.h>
    
    int main(void)
    {
    int x = -1,
    y = +3;
    if ((x%y > 0) ||
        ((x+y)%y == x%y))
        printf("This is a C90 translator behaving differently than C99\n");
    }
    
    Quoting from the C9X Revision Proposal, WG14/N613, that proposed this change:
    The origin of this practice seems to have been a desire to map C’s division directly to the “natural” behavior of the target instruction set, whatever it may be, without requiring extra code overhead that might be necessary to check for special cases and enforce a particular behavior. However, the argument that Fortran programmers are unpleasantly surprised by this aspect of C and that there would be negligible impact on code efficiency was accepted by WG14, who agreed to require Fortran-like behavior in C99.
  • Horvath, Adam. Faster division and modulo operation - the power of two. July 5, 2012. (原始内容存档于2018-03-05) (英语). 

xs4all.nl

jmvdveer.home.xs4all.nl

  • A. van Wijngaarden, B. J. Mailloux, J. E. L. Peck, C. H. A. Koster, M. Sintzoff, C. H. Lindsey, L. G. L.T. Meertens and R. G. Fisker. Revised Report on the Algorithmic Language Algol 68. IFIP W.G. 2.1. 
    10.2.3.3. Operations on integral operands
    ……
    m) OP «÷, %, OVER» = (L INT a, b) L INT:
          IF b ≠ L 0
          THEN L INT q := L 0, r := ABS a;
             WHILE (r := r - ABS b) ≥ L 0 DO q := q + L 1 OD;
             (a < L 0 AND b > L 0 OR a ≥ L 0 AND b < L 0 | -q | q)
          FI;
    n) OP «÷×, ÷*, %*, MOD» = (L INT a, b) L INT:
          (L INT r = a - a ÷ b × b; r < 0 | r + ABS b | r);
    

ziglang.org