List of operators for the remainder of a division

from Wikipedia, the free encyclopedia

This list contains operators in various programming languages with which the remainder of a division can be calculated.

division

It's about the rest of the division

,

whereby the divisor cannot be zero .

Operators for the remainder of an integer division

Operators for the remainder of an integer division in various programming languages
programming language operator The result has the same sign as ...
For comparison:
mathematical modulo function
divisor
ActionScript % dividend
Ada mod divisor
rem dividend
ASP Mod Not defined
asymptote % divisor
Algol 68 Always positive
AMPL mod dividend
AppleScript mod dividend
BASIC Mod Not defined
bc % dividend
bash % dividend
C (ISO 1990) % Depends on implementation
C (ISO 1999) % dividend
C ++ (ISO 1998) % Depends on implementation
C ++ (ISO 2011) % dividend
C # % dividend
CLARION % dividend
Clojure mod divisor
COBOL FUNCTION MOD divisor
ColdFusion %, MOD dividend
Common Lisp mod divisor
rem dividend
D. % dividend
Darts % divisor
Eiffel \\ dividend
Erlang rem dividend
Euphoria mod divisor
remainder dividend
F # % dividend
FileMaker Mod divisor
Fortran mod dividend
modulo divisor
Frink mod divisor
GML (Game Maker) mod dividend
Go % dividend
Haskell mod divisor
rem dividend
J |~ divisor
Java % dividend
JavaScript % dividend
Lua 5 % divisor
Lua 4 mod(x,y) divisor
Liberty Basic MOD dividend
Mathcad mod(x,y) dividend
Maple e mod m Always positive
Mathematica Mod divisor
MATLAB mod divisor
rem dividend
Maxima mod divisor
remainder dividend
Maya Embedded Language fmod Always positive
Microsoft Excel =MOD(a;b) or. =REST(a;b) divisor
Minitab MOD divisor
mksh % dividend
MUMPS # divisor
Oberon MOD divisor
OCaml mod dividend
Occam \ dividend
Pascal (Delphi) mod dividend
Pascal (ISO-7185 and ISO-10206) mod Always positive
Pearl % divisor
PHP % dividend
PIC Basic Pro \\ dividend
PL / I mod Divisor (ANSI PL / I)
PowerBuilder mod(x,y) ?
PowerShell % dividend
progress modulo dividend
Prolog (ISO 1995) mod divisor
rem dividend
python % divisor
REALbasic MOD dividend
R. %% divisor
RPG %REM dividend
Ruby %, modulo() divisor
remainder() dividend
Scala % dividend
Scheme modulo divisor
remainder dividend
Scheme R 6 RS mod Always positive
mod0 Closest to zero
Seed7 mod divisor
rem dividend
SenseTalk modulo divisor
rem dividend
Small talk \\ divisor
rem: dividend
SQL ( SQL: 1999 ) mod(x,y) dividend
Standard ML mod divisor
Int.rem dividend
Stata mod(x,y) Always positive
Tcl % divisor
Torque game engine % dividend
Turing mod divisor
Verilog (2001) % dividend
VHDL mod divisor
rem dividend
Visual Basic Mod dividend
x86 assembler IDIV dividend

Floating point operators for the remainder of a division

Floating point operators for the remainder of a division in various programming languages
programming language operator The result has the same sign as ...
C (ISO 1990) fmod ?
C (ISO 1999) fmod dividend
remainder Closest to zero
C ++ (ISO 1998) std::fmod ?
C ++ (ISO 2011) std::fmod dividend
std::remainder Closest to zero
C # % dividend
Common Lisp mod divisor
rem dividend
D. % dividend
F # % dividend
Fortran mod dividend
modulo divisor
Go math.Fmod dividend
Haskell (GHC) Data.Fixed.mod' divisor
Java % dividend
JavaScript % dividend
OCaml mod_float dividend
Pearl POSIX::fmod dividend
Perl6 % divisor
PHP fmod dividend
python % divisor
math.fmod dividend
Ruby %, modulo() divisor
remainder() dividend
Scheme R 6 RS flmod Always positive
flmod0 Closest to zero
Standard ML Real.rem dividend

See also

Individual evidence

  1. Andy Hammerlindl, John Bowman, Tom Prince: Asymptote: the Vector Graphics Language - Documentation. Retrieved October 3, 2018 .
  2. http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf , section 6.5.5
  3. ISO / IEC 14882: 2003: Programming languages ​​- C ++ . In: ISO , IEC . , 5.6.42003. . "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".
  4. Expressions . In: D Programming Language 2.0 . Digital Mars. Retrieved July 29, 2010.
  5. a b http://www.r6rs.org/final/html/r6rs/r6rs-ZH-14.html#node_sec_11.7.3.1