Meta tags:
Headings (most frequently used words):
modulo, contents, variants, of, the, definition, notation, common, pitfalls, performance, issues, properties, identities, in, programming, languages, generalizations, see, also, notes, references, external, links, with, offset, implementing, other, definitions, using, truncation,
Text of the page (most frequently used words):
yes (274), the (194), mod (142), truncated (121), retrieved (106), and (75), 2026 (67), floored (66), remainder (58), #modulo (46), java (43), org (40), rem (37), com (36), for (34), programming (31), division (31), docs (30), displaystyle (29), language (28), api (28), euclidean (28), frac (27), standard (25), left (25), right (25), reference (24), languages (22), math (22), platform (22), that (22), documentation (21), function (21), oracle (21), edition (21), are (19), 2021 (18), negative (18), same (18), edit (17), iso (17), operation (16), defined (16), quotient (16), this (15), integer (15), lang (15), fmod (15), which (15), 2022 (14), iec (14), lfloor (14), rfloor (14), tcl (13), positive (13), rounded (13), dividend (13), operators (12), www (12), denom (12), using (11), with (11), both (11), some (11), sign (11), definition (11), long (11), arithmetic (10), operator (10), sec (10), where (10), int (10), common (10), has (10), when (10), but (10), see (10), thus (10), divisor (10), page (9), operations (9), dev (9), then (9), not (9), other (9), sgn (9), non (8), from (8), core (8), mathematical (8), functions (8), developer (8), expressions (8), also (8), basic (8), two (8), div (8), definitions (8), can (8), wikipedia (7), numbers (7), specification (7), 2024 (7), microsoft (7), undefined (7), one (7), dart (7), clojure (7), such (7), number (7), round (7), operatorname (7), text (6), use (6), example (6), modular (6), php (6), manual (6), apple (6), perl (6), binary (6), mathematics (6), pkg (6), big (6), properties (6), values (6), result (6), expression (6), implementation (6), these (6), numer (6), offset (6), constant (6), equation (6), rounding (6), trunc (6), search (5), about (5), may (5), agree (5), wolfram (5), version (5), commands (5), expr (5), ansi (5), standards (5), racket (5), python (5), std (5), ocaml (5), library (5), help (5), kotlin (5), cases (5), integers (5), package (5), godot (5), fortran (5), class (5), 2012 (5), ieeeremainder (5), systems (5), uses (5), many (5), ldiv_t (5), return (5), textstyle (5), notation (5), zero (5), signed (5), unsigned (5), ceiling (5), because (5), according (5), mathbb (5), contents (4), code (4), links (4), 2020 (4), mathop (4), national (4), institute (4), information (4), technology (4), command (4), rust (4), posix (4), nim (4), archived (4), original (4), engine (4), pdf (4), operands (4), openeuphoria (4), returns (4), c99 (4), like (4), pascal (4), define (4), bmod (4), between (4), general (4), all (4), following (4), case (4), have (4), sql (4), lceil (4), rceil (4), aligned (4), computing (4), divided (4), hide (4), move (4), sidebar (4), toggle (3), table (3), view (3), under (3), terms (3), computer (3), multiplication (3), april (3), system (3), zig (3), mathfunc (3), american (3), pubs (3), opengroup (3), stdlib (3), nasm (3), support (3), after (3), matlab (3), julia (3), sides (3), data (3), types (3), globalscope (3), section (3), glsl (3), january (3), new (3), york (3), full (3), numeric (3), factor (3), github (3), euphoria (3), erlang (3), elm (3), elixir (3), method (3), css (3), style (3), coffeescript (3), learn (3), 1999 (3), 9899 (3), first (3), multiplicative (3), algol (3), ada (3), faster (3), boute (3), 127 (3), knuth (3), prime (3), examples (3), identity (3), leave (3), choices (3), here (3), quot (3), divmod (3), truncation (3), let (3), floor (3), generalizations (3), floormod (3), strictmath (3), lisp (3), inverse (3), side (3), performance (3), possible (3), always (3), used (3), expressed (3), bitwise (3), is_odd (3), bool (3), test (3), however (3), begin (3), end (3), down (3), cdot (3), article (3), tools (3), main (3), add (2), contact (2), privacy (2), policy (2), available (2), organization (2), was (2), categories (2), articles (2), short (2), description (2), wikidata (2), external (2), webassembly (2), solidity (2), 1998 (2), smalltalk (2), generic (2), numerics (2), 2018 (2), purebasic (2), net (2), perldoc (2), ieee (2), netwide (2), assembler (2), 118 (2), doi (2), mumps (2), mathworks (2), get (2), libreoffice (2), julialang (2), only (2), either (2), floating (2), point (2), haxe (2), haskell (2), 1987 (2), frink (2), manipulation (2), factorcode (2), fsharp (2), basics (2), hexdocs (2), 2025 (2), num (2), mozilla (2), cascading (2), sheets (2), mdn (2), jtc (2), 2023 (2), cobol (2), double (2), 1990 (2), magnitude (2), than (2), 2003 (2), nonnegative (2), international (2), august (2), awk (2), revised (2), report (2), adobe (2), actionscript (2), abap (2), july (2), power (2), 2001 (2), 2019 (2), raymond (2), acm (2), donald (2), residue (2), congruence (2), references (2), namespace (2), independently (2), rational (2), produces (2), includes (2), others (2), must (2), otherwise (2), behavior (2), including (2), notes (2), exponentiation (2), disambiguation (2), calculated (2), inline (2), truncating (2), part (2), generally (2), more (2), calculating (2), given (2), implementing (2), implemented (2), mathematica (2), true (2), what (2), now (2), take (2), related (2), follows (2), usual (2), useful (2), called (2), time (2), idiv (2), x86 (2), theorem (2), 125 (2), i64 (2), rem_s (2), i32 (2), rem_u (2), dividingby (2), 116 (2), 114 (2), scheme (2), lua (2), javascript (2), biginteger (2), ceilmod (2), remainderunsigned (2), various (2), hand (2), identities (2), optimizations (2), modulus (2), exist (2), optimization (2), implement (2), simple (2), will (2), equivalence (2), instead (2), alternative (2), might (2), special (2), hardware (2), assuming (2), issues (2), signs (2), odd (2), pitfalls (2), similar (2), any (2), calculators (2), falls (2), depends (2), even (2), promotes (2), satisfy (2), chosen (2), neq (2), representative (2), variants (2), being (2), appearance (2), upload (2), file (2), changes (2), history (2), read (2), english (2), log (2), create (2), account (2), donate (2), menu (2), topic, mobile, cookie, statement, statistics, developers, conduct, legal, safety, contacts, disclaimers, additional, apply, site, you, registered, trademark, profit, wikimedia, foundation, inc, creative, commons, attribution, sharealike, license, rendered, parsoid, last, edited, september, utc, hidden, matches, https, index, title, oldid, 1373722450, animation, cyclic, representation, tables, explanation, french, modulorama, research, center, rossberg, andreas, world, wide, web, consortium, built, soliditylang, incits, 319, r2002, shell, r6rs, f32, doc, project, quantumwriter, euclideanring, interface, 1003, browser, chapter, 1976, gaithersburg, dept, commerce, 6028, nbs, neill, joseph, autodesk, june, unlike, operates, well, cross, toolkit, predefined, classes, results, frinklang, dll, kernel, gnu, arbitrary, precision, calculator, dlang, lispworks, clhs, february, iii, 23271, infrastructure, cli, 1989, dotnet, bot, compute, required, 60559, value, nonzero, less, yields, second, electrotechnical, commission, standardization, 14882, 2005, tc2, 1973, ifip, wg2, algorithmic, multiplying, 8652, as3, sap, keyword, horvath, adam, archive, adaic, lrm, evaluation, peterson, doctor, october, forum, ask, 1992, press, usa, 144, 8321674, s2cid, 1854, 314490, hdl, 1145, 128861, 128862, transactions, 1972, addison, wesley, art, caldwell, chris, glossary, weisstein, eric, mathworld, 124, 121, defines, applied, inexact, excludes, 109, usually, machine, independent, exceptions, discussed, obey, fundamentally, broken, before, argument, order, reverses, computes, dividing, omega, alpha, boldface, distinguish, keywords, identifiers, permits, formats, capitalization, mathematically, infinite, inequality, satisfied, turn, angle, term, word, grew, out, approach, 1801, carl, gauss, vice, versa, combined, save, screen, space, logical, branches, ldivf, else, ldive, structure, reproduced, clarity, struct, typedef, ldiv, despite, elegance, much, find, based, leijen, provides, algorithms, divisions, show, particular, means, wanted, prove, remains, shown, obtaining, seen, done, there, does, seem, tentatively, just, clearly, corresponds, sometimes, lie, particularly, addition, provide, functionality, include, instructions, architecture, prover, 126, xbase, fprem1, fprem, assembly, visual, viml, vhdl, verilog, turing, torque, tcsh, 123, 122, 120, truncatingremainder, 119, swift, stata, real, 2011, 117, spin, snap, 115, mksh, bash, sensetalk, seed7, scratch, flmod0, flmod, mod0, scala, sas, 113, rem_euclid, 112, ruby, rpg, rexx, reason, realbasic, raku, 111, 110, 108, 107, 106, 105, 104, pure, 103, purescript, 102, prolog, progress, prc, powershell, pic, pro, 101, 100, 7185, 10206, occam, mod_float, delphi, object, objective, oberon, nasmx, modula, minitab, excel, maya, embedded, maxima, frem, mods, default, modp, maple, mathcad, liberty, logo, labview, ksh, typescript, bigdecimal, mathcontext, hlsl, ghc, fixed, groovy, fposmod, posmod, gdscript, gml, gamemaker, studio, forth, filemaker, remainderby, modby, eiffel, crystal, intermediate, coldfusion, clean, clarion, varies, autolisp, applescript, apl, ampl, coprime, distributive, denotes, relatively, due, fermat, little, factored, expanded, similarly, proofs, involving, require, diffie, hellman, key, exchange, cryptography, recognize, form, automatically, them, allowing, programmer, write, clearer, without, compromising, unless, type, whereas, compiler, devices, software, efficiently, forms, calculations, each, alternatives, alternatively, powers, correct, regardless, incorrect, false, inclined, equal, lead, surprising, mistakes, environments, lacking, three, above, button, relation, satisfies, opposite, its, within, boundaries, half, 754, equivalently, emphasis, added, say, mathrm, color, red, leq, implementations, significant, digits, toward, integral, still, leaves, ambiguity, occur, choice, determines, consecutive, quotients, choose, depending, give, divisors, c90, details, though, theory, quad, nearly, conditions, member, smallest, belongs, conventions, computers, ways, storing, representing, their, underlying, least, exactly, breaks, differ, how, although, typically, performed, allow, range, evaluates, while, would, evaluate, often, abbreviated, another, latter, computational, redirected, free, encyclopedia, item, projects, printable, download, print, export, switch, legacy, parser, shortened, url, cite, permanent, link, actions, talk, tiếng, việt, türkçe, svenska, српски, srpski, slovenščina, română, português, polski, norsk, bokmål, 한국어, қазақша, 日本語, italiano, íslenska, bahasa, indonesia, հայերեն, français, فارسی, español, deutsch, dansk, català, العربية, subsection, top, personal, pages, recent, community, portal, contribute, random, current, events, navigation, jump, content,
Text of the page (random words):
no truncated 118 remainder dividingby no yes rounded 119 truncatingremainder dividingby no yes truncated 120 tcl expr a n tcl mathop a n i yes no floored 122 123 expr fmod a n tcl mathfunc fmod a n j no yes truncated same as c tcsh yes no truncated torque yes no truncated turing mod yes no floored verilog 2001 yes no truncated vhdl mod yes no floored rem yes no truncated viml yes no truncated visual basic mod yes no truncated webassembly i32 rem_u i64 rem_u unsigned yes no n a 125 i32 rem_s i64 rem_s signed yes no truncated 125 x86 assembly div unsigned yes no n a idiv signed yes no truncated fprem no yes truncated fprem1 no yes rounded xbase yes yes truncated mod yes yes floored zig rem yes yes truncated 126 mod yes yes floored z3 theorem prover div mod yes no euclidean in addition many computer systems provide a divmod functionality which produces the quotient and the remainder at the same time examples include the x86 architecture s div and idiv instructions the c programming language s div function and python s divmod function generalizations edit modulo with offset edit sometimes it is useful for the result of a modulo n to lie not between 0 and n 1 but between some number d and d n 1 in that case d is called an offset and d 1 is particularly common there does not seem to be a standard notation for this operation so let us tentatively use a mod d n we thus have the following definition 127 x a mod d n just in case d x d n 1 and x mod n a mod n clearly the usual modulo operation corresponds to zero offset a mod n a mod 0 n the operation of modulo with offset is related to the floor function as follows a mod d n a n a d n displaystyle a operatorname mod _ d n a n left lfloor frac a d n right rfloor to see this let x a n a d n textstyle x a n left lfloor frac a d n right rfloor we first show that x mod n a mod n it is in general true that a bn mod n a mod n for all integers b thus this is true also in the particular case when b a d n textstyle b left lfloor frac a d n right rfloor but that means that x mod n a n a d n mod n a mod n textstyle x bmod n left a n left lfloor frac a d n right rfloor right bmod n a bmod n which is what we wanted to prove it remains to be shown that d x d n 1 let k and r be the integers such that a d kn r with 0 r n 1 see euclidean division then a d n k textstyle left lfloor frac a d n right rfloor k thus x a n a d n a n k d r textstyle x a n left lfloor frac a d n right rfloor a nk d r now take 0 r n 1 and add d to both sides obtaining d d r d n 1 but we ve seen that x d r so we are done the modulo with offset a mod d n is implemented in mathematica as mod a n d 127 implementing other modulo definitions using truncation edit despite the mathematical elegance of knuth s floored division and euclidean division it is generally much more common to find a truncated division based modulo in programming languages leijen provides the following algorithms for calculating the two divisions given a truncated integer division euclidean and floored divmod in the style of c s ldiv typedef struct this structure is part of the c stdlib h but is reproduced here for clarity long int quot long int rem ldiv_t euclidean division inline ldiv_t ldive long numer long denom the c99 and c 11 languages define both of these as truncating long q numer denom long r numer denom if r 0 if denom 0 q q 1 r r denom else q q 1 r r denom return ldiv_t quot q rem r floored division inline ldiv_t ldivf long numer long denom long q numer denom long r numer denom if r 0 denom 0 r 0 denom 0 q q 1 r r denom return ldiv_t quot q rem r for both cases the remainder can be calculated independently of the quotient but not vice versa the operations are combined here to save screen space as the logical branches are the same see also edit modulo disambiguation many uses of the word modulo all of which grew out of carl f gauss approach to modular arithmetic in 1801 modulo mathematics general use of the term in mathematics modular exponentiation turn angle notes edit mathematically these two choices are but two of the infinite number of choices available for the inequality satisfied by a remainder the revised report uses boldface to distinguish between keywords and identifiers but permits other formats including capitalization e g mod 1 2 argument order reverses i e α ω computes ω mod α displaystyle omega bmod alpha the remainder when dividing ω by α c99 and c 11 define the behavior of to be truncated 14 the standards before then leave the behavior implementation defined 15 divisor must be positive otherwise undefined as discussed by boute iso pascal s definitions of div and mod do not obey the division identity of d d d d d d and are thus fundamentally broken perl usually uses arithmetic modulo operator that is machine independent for examples and exceptions see the perl documentation on multiplicative operators 98 1 2 racket defines an integer as a rational number for which round produces the same number when applied this includes some inexact numbers like 42 0 but excludes others like 3 14 109 the expr command is defined independently of commands in the tcl mathop namespace 121 the expr command is defined in terms of commands in the tcl mathfunc namespace 124 references edit weisstein eric w congruence wolfram mathworld retrieved 2020 08 27 caldwell chris residue prime glossary retrieved august 27 2020 knuth donald e 1972 the art of computer programming addison wesley boute raymond t april 1992 the euclidean definition of the functions div and mod acm transactions on programming languages and systems 14 2 acm press new york ny usa 127 144 doi 10 1145 128861 128862 hdl 1854 lu 314490 s2cid 8321674 peterson doctor 5 july 2001 mod function and negative numbers math forum ask dr math archived from the original on 2019 10 22 retrieved 22 october 2019 ada 83 lrm sec 4 5 operators and expression evaluation archive adaic com retrieved 2025 03 03 horvath adam july 5 2012 faster division and modulo operation the power of two abap keyword documentation help sap com 2024 retrieved 2026 01 18 operators adobe actionscript 3 as3 api reference help adobe com retrieved 2026 01 19 1 2 iso iec 8652 2012 information technology programming languages ada iso iec 2012 sec 4 5 5 multiplying operators revised report on the algorithmic language algol 68 ifip wg2 1 1973 sec 10 2 3 3 n awk pubs opengroup org retrieved 2026 01 19 bc pubs opengroup org retrieved 2026 05 23 c99 specification iso iec 9899 tc2 pdf 2005 05 06 sec 6 5 5 multiplicative operators retrieved 16 august 2018 iso iec 14882 2003 programming languages c international organization for standardization iso international electrotechnical commission iec 2003 sec 5 6 4 the binary operator yields the remainder from the division of the first expression by the second if both operands are nonnegative then the remainder is nonnegative if not the sign of the remainder is implementation defined iso iec 9899 1990 programming languages c iso iec 1990 sec 7 5 6 4 the fmod function returns the value x i y for some integer i such that if y is nonzero the result has the same sign as x and magnitude less than the magnitude of y iso iec 9899 1999 programming languages c iso iec 1999 sec 7 12 10 2 the remainder functions compute the remainder x rem y required by iec 60559 expressions c language specification learn microsoft com retrieved 2026 01 19 1 2 dotnet bot math ieeeremainder double double method system microsoft learn retrieved 2022 10 04 clojure core clojure v1 10 3 api documentation clojure github io retrieved 2022 03 16 clojure core clojure v1 10 3 api documentation clojure github io retrieved 2022 03 16 1 2 iso iec jtc 1 sc 22 wg 4 january 2023 iso iec 1989 2023 programming language cobol iso 1 2 coffeescript coffeescript org retrieved 2026 07 22 iso iec jtc 1 sc 22 february 2012 iso iec 23271 2012 information technology common language infrastructure cli iso iii 3 55 56 1 2 clhs function mod rem www lispworks com retrieved 2026 01 20 mod css cascading style sheets mdn developer mozilla org 2024 06 22 retrieved 2024 10 23 rem css cascading style sheets mdn developer mozilla org 2024 10 15 retrieved 2024 10 23 expressions d programming language dlang org retrieved 2021 06 01 operator method num class dart core library dart api api dart dev retrieved 2021 06 01 remainder method num class dart core library dart api api dart dev retrieved 2021 06 01 dc an arbitrary precision calculator www gnu org archived from the original on 2025 12 10 retrieved 2026 05 23 kernel elixir v1 11 3 hexdocs pm retrieved 2021 01 28 integer elixir v1 11 3 hexdocs pm retrieved 2021 01 28 basics core 1 0 5 package elm lang org retrieved 2022 03 16 basics core 1 0 5 package elm lang org retrieved 2022 03 16 erlang math erlang org retrieved 2021 06 01 openeuphoria euphoria v4 0 openeuphoria org retrieved 2026 01 20 openeuphoria euphoria v4 0 openeuphoria org retrieved 2026 01 20 18 the f library fsharp core dll f language specification fsharp github io retrieved 2026 01 19 mod x y z factor documentation docs factorcode org retrieved 2026 01 21 rem x y z factor documentation docs factorcode org retrieved 2026 01 21 manipulation and properties of numeric values fortran programming language fortran lang org retrieved 2026 05 22 manipulation and properties of numeric values fortran programming language fortran lang org retrieved 2026 05 22 frink frinklang org retrieved 2026 07 22 ansi 28 january 1987 programming languages full basic new york american national standards institute 5 4 4 x modulo y i e x y int x y ansi 28 january 1987 programming languages full basic new york american national standards institute 5 4 4 the remainder function i e x y ip x y glsl language specification version 4 50 7 pdf section 5 9 expressions if both operands are non negative then the remainder is non negative results are undefined if one or both operands are negative glsl language specification version 4 50 7 pdf section 8 3 common functions int godot engine documentation retrieved 2026 01 19 globalscope godot engine documentation retrieved 2026 01 19 globalscope godot engine documentation retrieved 2026 01 19 globalscope godot engine documentation retrieved 2026 01 19 the go programming language specification the go programming language go dev retrieved 2022 02 28 math package math pkg go dev pkg go dev retrieved 2022 02 28 big package math big pkg go dev pkg go dev retrieved 2022 02 28 big package math big pkg go dev pkg go dev retrieved 2024 04 12 1 2 6 predefined types and classes www haskell org retrieved 2022 05 22 binary operators haxe the cross platform toolkit retrieved 2026 01 20 operators microsoft 30 june 2021 retrieved 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 java platform standard edition java api reference docs oracle com retrieved 2026 05 24 java platform standard edition java api reference docs oracle com retrieved 2026 05 25 java platform standard edition java api reference docs oracle com retrieved 2026 05 25 java platform standard edition java api reference docs oracle com retrieved 2026 05 25 java platform standard edition java api reference docs oracle com retrieved 2026 05 25 java platform standard edition java api reference docs oracle com retrieved 2026 05 25 java platform standard edition java api reference docs oracle com retrieved 2026 05 25 java platform standard edition java api reference docs oracle com retrieved 2026 05 25 java platform standard edition java api reference docs oracle com retrieved 2026 05 25 java platform standard edition java api reference docs oracle com retrieved 2026 05 25 java platform standard edition java api reference docs oracle com retrieved 2026 05 25 java platform standard edition java api reference docs oracle com retrieved 2026 05 25 java platform standard edition java api reference docs oracle com retrieved 2026 05 25 java platform standard edition java api reference docs oracle com retrieved 2026 05 25 java platform standard edition java api reference docs oracle com retrieved 2026 05 25 java platform standard edition java api reference docs oracle com retrieved 2026 05 25 java platform standard edition java api reference docs oracle com retrieved 2026 05 25 java platform standard edition java api reference docs oracle com retrieved 2026 05 25 java platform standard edition java api reference docs oracle com retrieved 2026 05 25 java platform standard edition java api reference docs oracle com retrieved 2026 05 25 java platform standard edition java api reference docs oracle com retrieved 2026 05 25 mathematics the julia language docs julialang org retrieved 2021 11 20 mathematics the julia language docs julialang org retrieved 2021 11 20 rem kotlin programming language kotlin retrieved 2021 05 05 mod kotlin programming language kotlin retrieved 2021 05 05 mathematical functions help libreoffice org retrieved 2026 01 21 mod get the remainder on division wolfram documentation reference wolfram com retrieved 2026 05 25 mod remainder after division modulo operation matlab www mathworks com archived from the original on 2026 01 15 retrieved 2026 01 21 rem remainder after division matlab www mathworks com archived from the original on 2026 01 01 retrieved 2026 01 21 fmod command help autodesk com retrieved 2026 06 14 mod function microsoft support support microsoft com retrieved 2026 01 21 o neill joseph t et al 1976 mumps language standard gaithersburg md u s dept of commerce national institute of standards and technology sec 3 3 1 arithmetic binary operators doi 10 6028 nbs hb 118 chapter 3 the nasm language nasm the netwide assembler version 2 15 05 system nim lang org retrieved 2026 06 15 std math nim lang org retrieved 2026 06 15 std math nim lang org retrieved 2026 06 15 ocaml library stdlib ocaml org retrieved 2022 02 19 ocaml library stdlib ocaml org retrieved 2022 02 19 perl documentation posix perl interface to ieee std 1003 1 perldoc browser perldoc perl org retrieved 2026 05 22 php arithmetic operators manual www php net retrieved 2021 11 20 php fmod manual www php net retrieved 2021 11 20 mod www purebasic com retrieved 2026 07 22 euclideanring 6 expressions python documentation retrieved 2026 01 21 math mathematical functions python documentation retrieved 2026 01 21 math mathematical functions python documentation retrieved 2026 01 21 quantumwriter expressions docs microsoft com retrieved 2018 07 11 r arithmetic operators search r project org retrieved 2022 12 24 4 3 numbers docs racket lang org retrieved 2026 07 22 4 3 2 generic numerics docs racket lang org retrieved 2026 07 22 4 3 2 generic numerics docs racket lang org retrieved 2026 07 22 operator expressions the rust reference doc rust lang org retrieved 2026 01 21 f32 rust 1 2 r6rs org shell command language pubs opengroup org retrieved 2021 02 05 1 2 ansi incits 319 1998 r2002 ...
|