"fmod" redirects here. For the computer audio library, see FMOD. In computing, the modulo operation finds the remainder of division of one number by another. FMOD is an audio library that makes it possible to play music files of diverse formats on many different platforms. ...
For the formal concept of computation, see computation. ...
In mathematics, the result of the division of two integers usually cannot be expressed with an integer quotient, unless a remainder âan amount left overâ is also acknowledged. ...
In mathematics, especially in elementary arithmetic, division is an arithmetic operation which is the inverse of multiplication. ...
Given two numbers, a (the dividend) and n (the divisor), a modulo n (abbreviated as a mod n) is the remainder, on division of a by n. For instance, the expression "7 mod 3" would evaluate to 1, while "9 mod 3" would evaluate to 0. Although typically performed with a and n both being integers, many computing systems allow other types of numeric operands. See modular arithmetic for an older and related convention applied in number theory. Modular arithmetic (sometimes called modulo arithmetic, or clock arithmetic because of its use in the 24-hour clock system) is a system of arithmetic for integers, where numbers wrap around after they reach a certain value â the modulus. ...
Number theory is the branch of pure mathematics concerned with the properties of numbers in general, and integers in particular, as well as the wider classes of problems that arise from their study. ...
Remainder calculation for the modulo operation There are various ways of defining a remainder, and computers and calculators have various ways of storing and representing numbers, so what exactly constitutes the result of a modulo operation depends on the programming language and/or the underlying hardware. ActionScript is a scripting language based on ECMAScript, used primarily for the development of websites and software using the Adobe Flash Player platform (in the form of SWF files embedded into Web pages). ...
In mathematics, especially in elementary arithmetic, division is an arithmetic operation which is the inverse of multiplication. ...
Ada is a structured, statically typed, imperative, and object-oriented high-level computer programming language. ...
In mathematics, especially in elementary arithmetic, division is an arithmetic operation which is the inverse of multiplication. ...
Active Server Pages (ASP) is Microsofts server-side script engine for dynamically-generated web pages. ...
C is a general-purpose, block structured, procedural, imperative computer programming language developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system. ...
C is a general-purpose, block structured, procedural, imperative computer programming language developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system. ...
For a WikiBook on programming with C++, see Wikibooks: C++ Programming. ...
The title given to this article is incorrect due to technical limitations. ...
This article or section does not adequately cite its references or sources. ...
Common Lisp, commonly abbreviated CL, is a dialect of the Lisp programming language, published in ANSI standard X3. ...
Eiffel is an ISO-standardized, object-oriented programming language designed to enable programmers efficiently to develop extensible, reusable, reliable software. ...
Microsoft Excel (full name Microsoft Office Excel) is a spreadsheet application written and distributed by Microsoft for Microsoft Windows and Mac OS. It features calculation and graphing tools which, along with aggressive marketing, have made Excel one of the most popular microcomputer applications to date. ...
Euphoria is an interpreted programming language created by Robert Craig of Rapid Deployment Software. ...
FileMaker Pro is a cross-platform database application from FileMaker Inc. ...
Fortran (previously FORTRAN[1]) is a general-purpose[2], procedural,[3] imperative programming language that is especially suited to numeric computation and scientific computing. ...
This article is about GML, the scripting language of Game Maker. ...
The J programming language, developed in the early 1990s by Ken Iverson and Roger Hui, is a synthesis of APL (also by Iverson) and the FP and FL function-level languages created by John Backus. ...
Java language redirects here. ...
JavaScript is a scripting language most often used for client-side web development. ...
In computing, the Lua (pronounced LOO-ah) programming language is a lightweight, reflective, imperative and procedural language, designed as a scripting language with extensible semantics as a primary goal. ...
Mathcad (originally written MathCAD) is desktop software for performing and documenting engineering and scientific calculations. ...
For other uses, see Mathematica (disambiguation). ...
Not to be confused with Matlab Upazila in Chandpur District, Bangladesh. ...
MySQL (pronounced (IPA) , my S-Q-L[1]) is a multithreaded, multi-user SQL database management system (DBMS)[2] which has, according to MySQL AB, more than 10 million installations. ...
Objective Caml (OCaml) is the main implementation of the Caml programming language, created by Xavier Leroy, Jérôme Vouillon, Damien Doligez, Didier Rémy and others in 1996. ...
Occam or Ockham can refer to: The philosopher William of Ockham, see also Occams Razor William of Ockhams birth town, Ockham, Surrey The Occam programming language This is a disambiguation page — a navigational aid which lists other pages that might otherwise share the same title. ...
Pascal is a structured imperative computer programming language, developed in 1970 by Niklaus Wirth as a language particularly suitable for structured programming. ...
For other uses, see Perl (disambiguation). ...
For other uses, see PHP (disambiguation). ...
PL/I (Programming Language One, pronounced pee el one) is an imperative computer programming language designed for scientific, engineering, and business applications. ...
Prolog is a logic programming language. ...
Python is a general-purpose, high-level programming language. ...
QBasic is an IDE and interpreter for a variant of the BASIC programming language which is based on QuickBasic. ...
For the database, see IBM System R The R programming language, sometimes described as GNU S, is a programming language and software environment for statistical computing and graphics. ...
RPG is a native programming language for IBMs iSeries servers - the latest generation of midrange servers which included System/38, System/36, AS/400, iSeries and System i5 systems. ...
Ruby is a reflective, object-oriented programming language. ...
Scheme is a multi-paradigm programming language and a dialect of Lisp which supports functional and procedural programming. ...
SenseTalk is possibly the most English-like scripting language available in the world today. ...
Tcl (originally from Tool Command Language, but nonetheless conventionally rendered as Tcl rather than TCL; and pronounced tickle) is a scripting language created by John Ousterhout. ...
Verilog is a hardware description language (HDL) used to model electronic systems. ...
VHDL, or VHSIC Hardware Description Language, is commonly used as a design-entry language for field-programmable gate arrays and application-specific integrated circuits in electronic design automation of digital circuits. ...
This article is about the Visual Basic language shipping with Microsoft Visual Studio 6. ...
A programming language is an artificial language that can be used to control the behavior of a machine, particularly a computer. ...
Computer hardware is the physical part of a computer, including the digital circuitry, as distinguished from the computer software that executes within the hardware. ...
In nearly all computing systems, the quotient resulting from the division is constrained to the set of integers, and the remainder r is typically constrained by either or . The choice between the two possible remainders depends on the signs of a and n and the programming language being used.[2] Some programming languages, such as C89, don't even define a result if either of n or a is negative. See the table for details. a modulo 0 is undefined in the majority of systems, although some do define it to be a. If the definition is consistent with the division algorithm, then n = 0 implies , which is a contradiction (i.e., the usual remainder does not exist in this case). The remainder can be calculated by using equations, in terms of other functions. Differences may arise according to the scope of the variables, which in common implementations is broader than in the definition just given. One useful equation for calculating the remainder r is  where is the floor function of x. See e.g. [3], [4], [5]. The floor and fractional part functions In mathematics, the floor function of a real number x, denoted or floor(x), is the largest integer less than or equal to x (formally, ). For example, floor(2. ...
Raymond T. Boute[2] analyzed several definitions of integer division and modulo, and he introduces the “Euclidean” definition. Let q be the integer quotient of a and n, then:    Two corollaries are that   As described by Leijen,[3] - Boute argues that Euclidean division is superior to the other ones in terms of regularity and useful mathematical properties, although floored division, promoted by Knuth, is also a good definition. Despite its widespread use, truncated division is shown to be inferior to the other definitions.
Modulo operation expression Some calculators have a mod() function button, and many programming languages have a mod() function or similar, expressed as mod(a, n), for example. Some also support expressions that use "%", "mod", or "Mod" as a modulo or remainder operator, such as a % n or a mod n. Performance issues Modulo operations might be implemented such that division with remainder is calculated each time. For special cases, there are faster alternatives on some hardware. For example, the modulus of powers of 2 can alternatively be expressed as a bitwise AND operation: In computer programming, a bitwise operation operates on one or two bit patterns or binary numerals at the level of their individual bits. ...
x % 2n == x & (2n - 1). Examples (assuming x is an integer): x % 2 == x & 1 x % 4 == x & 3 x % 8 == x & 7. In devices and software that implement bitwise operations more efficiently than modulo, these alternative forms can result in faster calculations. In the C programming language, compiling with heavy speed optimizations will typically (depending on compiler and hardware) automatically convert modulo operations to bitwise AND in the assembly file. Wikibooks has a book on the topic of C Programming The C programming language (often, just C) is a general-purpose, procedural, imperative computer programming language developed in the early 1970s by Dennis Ritchie for use on the Unix operating system. ...
A diagram of the operation of a typical multi-language, multi-target compiler. ...
In some compilers, the modulo operation is implemented as mod(a, n) = a - n * floor(a / n). When performing both modulo and division on the same numbers, one can get the same result somewhat more efficiently by avoiding the actual modulo operator, and using the formula above on the result, avoiding an additional division operation.
See also - Modulo — many uses of the word "modulo", all of which grew out of Carl F. Gauss's introduction of modular arithmetic in 1801.
The word modulo (Latin, with respect to a modulus of ___) is the Latin ablative of modulus which itself means a small measure. ...
Johann Carl Friedrich Gauss Johann Carl Friedrich Gauss (Gauß) (April 30, 1777 _ February 23, 1855) was a legendary German mathematician, astronomer and physicist with a very wide range of contributions; he is considered to be one of the greatest mathematicians of all time. ...
Notes In mathematics, the result of the division of two integers usually cannot be expressed with an integer quotient, unless a remainder âan amount left overâ is also acknowledged. ...
References - ^ ISO/IEC 14882:2003 : Programming languages -- C++, 5.6.4: ISO, IEC, 2003 . "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".
- ^ Boute, Raymond T. (April 1992). "The Euclidean definition of the functions div and mod". ACM Transactions on Programming Languages and Systems (TOPLAS) 14 (2): 127 – 144. ACM Press (New York, NY, USA).
- ^ Leijen, Daan (December 3, 2001). Division and Modulus for Computer Scientists (PDF). Retrieved on 2006-08-27.
âISOâ redirects here. ...
The International Electrotechnical Commission (IEC) is an international standards organization dealing with electrical, electronic and related technologies. ...
is the 337th day of the year (338th in leap years) in the Gregorian calendar. ...
This article is about the year. ...
Year 2006 (MMVI) was a common year starting on Sunday of the Gregorian calendar. ...
is the 239th day of the year (240th in leap years) in the Gregorian calendar. ...
|