integers
short, int, long | C, C# |
int | OCaml, PHP, SML, YAML |
Int | Perl6 |
Int, uInt, Int8, Int16... | Pliant |
int, long(1) | Python |
integer | Maple, PHP |
INTEGER, INT, SMALLINT | SQL92 |
INTEGER, INTEGER_8, NATURAL_8... | Eiffel |
int8, uint8, int16, uint16, ...64 | Go, Matlab |
int8_t, uint8_t, int16_t, uint16_t, ...64 | C99 |
int, int8, uint8, int16, uint16, int32, uint32, int64, uint64, bigint, bignum | F# |
Int, Integer, Int8, Int16, Int32, Int64 | Haskell |
Integer, FixNum, BigNum | Ruby |
Integer, SmallInteger, LargeInteger | Smalltalk |
Integer | Mathematica |
type T is range Low...High; | Ada |
number | Vimscript |
floating point
float, double, long double | C |
float, double | C# |
float | Maple, OCaml, PHP, SML, Vimscript, YAML |
Float | Ruby |
float, float32 | F# |
Float, Float32, Float64 | Pliant |
NUMERIC, DECIMAL, DOUBLE PRECISION | SQL92 |
Rat | Perl6 |
DOUBLE, REAL | Eiffel |
single, double | Matlab |
Float, Double, Ratio | Haskell |
Float, Double, Fraction, FixedPoint | Smalltalk |
float, decimal.Decimal | Python |
Real, Rational | Mathematica |
Number | Io |
type T is digits N range Low..High; | Ada |
type T is delta S digits N range Low..High;(2) | Ada |
float32, float64 | Go |
integers
1000 | Awk, B, BourneShell, C, C#, C++, CoffeeScript, E, Eiffel, F#, Forth, Go, Haskell, Io, Java, JavaScript, Logo, Maple, Mathematica, merd, OCaml, Oz, Pascal, Perl, Perl6, PHP, Pike, Pliant, Prolog, Python, Rebol, Ruby, Scheme, Smalltalk, SQL92, Tcl, Yorick |
1000, 1000. | Common Lisp, Emacs Lisp |
1000, 1000., 1000.0 | Awk, Matlab |
1000, '1000'D | Classic REXX |
1000, 1E3 | Ada |
integers in base 2, octal and hexadecimal
0b1, 07, 0xf(3) | CoffeeScript, Oz, Perl, PHP5, Pike, Ruby |
0b1, 0o7, 0xf | F#, OCaml, Perl6 |
07, 0xf | Awk, C, C++, JavaScript, Python, Tcl |
0xf | C#, E, Go, Io, Yorick |
07 | B |
0o7, 0xf | Haskell |
1b | Eiffel |
2#1#, 8#7#, 16#f# | Ada |
2#{1}, #{F} | Rebol |
#b1, #o7, #xf | Common Lisp, Emacs Lisp, Scheme |
2^^1, 8^^7, 16^^f | Mathematica |
2r1, 8r7, 16rf | Smalltalk |
#2r1, #8r7, #16rf | Common Lisp, Emacs Lisp |
1b, Fh | Pliant |
'1'B, 'F'X | Classic REXX |
B'1', X'F' | SQL92 |
$f | Forth |
integer thousand-separator
1_000, 10_00, 100_0 | Ada, E, Eiffel, OCaml, Perl, Perl6, Ruby |
1'000, 10'00, 100'0 | Rebol |
1_000 | merd |
floating point
1000., 1E3 | C, C++, Classic REXX, CoffeeScript, E, F#, Go, Java, JavaScript, Logo, Maple, OCaml, Python, Scheme, SQL92, Tcl |
1000., 1E3, 1,0 | Rebol |
1000., 1.E3 | Eiffel, Oz |
1000.0, 1E3 | C#, Common Lisp, Emacs Lisp, PHP, Pike, Prolog, Ruby, Smalltalk |
1000.0, 1.0E3 | Ada, Haskell |
1000, 1000.0, 1E3(4) | Awk, merd, Perl, Perl6 |
1000., 1*^3, 1000` | Mathematica |
1000e, 1e3 | Forth |
+ / - / * / / | BourneShell, C, C#, C++, Classic REXX, CoffeeScript, Common Lisp, D, Eiffel, Emacs Lisp, F#, Forth, Go, Haskell, Io, Java, JavaScript, Logo, Maple, Matlab, merd, MUMPS, Perl, Perl6, PHP, Pliant, Prolog, Python, Ruby, Scheme, Smalltalk, SQL92, Tcl, Vimscript, Yorick |
+ / - / * or nothing / / | Mathematica |
+ +. / - -. / * *. / / /.(5) | OCaml |
sum / difference / product / quotient | Logo |
add / sub / mul / idiv div | PostScript |
f+ / f- / f* / f/ | Forth |
** | Ada, Classic REXX, E, F#, Fortran, Io, merd, OCaml, Perl, Perl6, PL/I, Prolog, Python, Rebol, Ruby, Tcl8.5 |
^ | Awk, Dylan, Eiffel, Lua, Mathematica, Matlab, Pliant, Yorick |
*(6) | APL |
**, ^ | Maple |
^^ | D |
**, ^ and ^^(7) | Haskell |
f** | Forth |
pow | C, C++, CoffeeScript, Java, JavaScript, PHP, Pike, Python, SML, Tcl |
Pow | C#, Oz |
power | Delphi-Kylix, Logo, Rebol |
exp | PostScript |
expt | Common Lisp, Emacs Lisp, Scheme |
raisedTo | Smalltalk |
math.Pow | Go |
- | Ada, Awk, B, BCPL, BourneShell, C, C#, C++, Classic REXX, CoffeeScript, Common Lisp, D, E, Eiffel, Emacs Lisp, F#, Go, Haskell, Io, Java, JavaScript, Logo, Maple, Mathematica, Matlab, merd, MUMPS, Perl, Perl6, PHP, Pike, Pliant, Prolog, Python, Rebol, Ruby, Scheme, Smalltalk, Tcl, Vimscript, Yorick |
- -. | OCaml |
~ | Oz, SML |
neg | PostScript |
negate | Forth, Rebol |
fnegate | Forth |
minus | Logo |
random number
rand | C, Maple, Matlab, Perl, Perl6, PHP, Ruby, Tcl |
random | Common Lisp, Logo, Prolog, Python, Yorick |
$RANDOM | MUMPS |
randomR | Haskell |
Random(8) | Ada |
Random.int | OCaml |
Random, RandomReal, RandomInteger | Mathematica |
Random value | Io |
Random new nextInteger | Smalltalk |
r: RANDOM create r.make r.start r.item | Eiffel |
Random ran = new Random(); ran.Next(...); | C# |
let r = System.Random() r.Next() | F# |
mt_rand | PHP |
rand.Read(9) | Go |
seed the pseudo random generator
srand | C, Perl, Perl6, PHP, Ruby, Tcl |
set_seed | Eiffel |
random.seed | Python |
Random setSeed | Io |
Random.init, Random.self_init | OCaml |
rand('state',...) | Matlab |
rerandom | Logo |
RandomTools[MersenneTwister][SetState] | Maple |
Random new setSeed | Smalltalk |
SeedRandom | Mathematica |
mkStdGen | Haskell |
make-random-state | Common Lisp |
Reset | Ada |
rand.Seed(10) | Go |
addition vs multiplication
mathematical | BourneShell, C, C#, C++, Classic REXX, Eiffel, F#, Go, Haskell, Io, Java, Maple, Mathematica, Matlab, merd, Perl, Perl6, PHP, Python, Ruby, Tcl, Yorick |
same priorities | MUMPS, Smalltalk |
exponentiation vs negation (is -3^2 equal to 9 or -9)
mathematical | Classic REXX, Eiffel, Haskell, Io, Maple, Mathematica, Matlab, Perl, Perl6, Python, Ruby |
negation first | F#, OCaml |
sqrt / exp / abs | Ada, C, C++, CoffeeScript, Common Lisp, E, Eiffel, Emacs Lisp, F#, Haskell, Io, Java, JavaScript, Lua, Maple, OCaml, Pascal, Perl, Perl6, PHP, Prolog, Python, Ruby, Scheme, Smalltalk, SML, Tcl, Yorick |
sqrt realsqrt / exp / abs | Matlab |
sqrt / exp / | Awk, Logo |
Sqrt / Exp / Abs | C#, Mathematica, Oz |
sqrt / / abs | PostScript |
Sqrt / / ABS | Modula-3 |
/ exp / abs | Pliant |
sqrt / / | Pike |
square-root / exp / abs or absolute | Rebol |
Sqrt / Exp / ABS | Classic REXX |
sqrt,isqrt / exp / abs | Tcl8.5 |
fsqrt / fexp / abs,fabs | Forth |
math.Sqrt | Go |
basic
sin / cos / tan | Ada, C, C++, CoffeeScript, Common Lisp, E, Emacs Lisp, F#, Haskell, Io, Java, JavaScript, Lua, Maple, Matlab, OCaml, Pascal, Perl, Perl6, PHP, Pike, Pliant, Prolog, Python, Ruby, Scheme, Smalltalk, SML, Tcl, Yorick |
Sin / Cos / Tan | C#, Classic REXX, Mathematica, Oz |
sin / cos / | Awk, PostScript |
sine / cosine / tangent | Eiffel, Rebol |
radsin / radcos / radtan | Logo |
fsin / fcos / ftan | Forth |
math.Sin / math.Cos / math.Tan | Go |
inverse
asin / acos / atan(11) | Ada, C, C++, CoffeeScript, Common Lisp, F#, Haskell, Io, JavaScript, Matlab, OCaml, Perl, Perl6, Pike, Pliant, Prolog, Python, Ruby, Scheme, Tcl, Yorick |
Asin / Acos / Atan | C#, Oz |
ASin / ACos / ATan | Classic REXX |
arcsin / arccos / arctan | Maple |
arcSin / arcCos / arcTan | Smalltalk |
ArcSin / ArcCos / ArcTan | Mathematica |
arcsine / arccosine / arctangent | Rebol |
arc_sine / arc_cosine / arc_tangent | Eiffel |
/ / atan | PostScript |
/ / radarctan | Logo |
fasin / facos / fatan | Forth |
math.Asin / math.Acos / math.Atan | Go |
base e
ln | Delphi-Kylix, Logo, Maple, Pascal, PostScript, Smalltalk, SML |
log | Awk, C, C++, CoffeeScript, Common Lisp, E, Eiffel, Emacs Lisp, F#, Io, Java, JavaScript, Lua, Maple, Matlab, OCaml, Perl, Perl6, PHP, Pike, Pliant, Prolog, Python, Ruby, Scheme, Tcl, Yorick |
Log | Ada, C#, Classic REXX, Mathematica, Oz |
log 10 | Haskell |
log-e | Rebol |
fln | Forth |
math.Log | Go |
base 10
log10 | C, C++, Delphi-Kylix, Eiffel, F#, Io, Logo, Lua, Matlab, OCaml, Perl, Perl6, PHP, Pliant, Prolog, Python, Ruby, Tcl, Yorick |
Log10 | C#, Classic REXX |
log | PostScript, SML |
log: 10 | Smalltalk |
log-10 | Rebol |
log[10] | Maple |
Log[10, val] | Mathematica |
logBase 10 | Haskell |
Log(X => val, Base => 10.0) | Ada |
(log x 10) | Common Lisp |
flog | Forth |
math.Log10 | Go |
base 2
log2 | Matlab |
log-10 / log-2 | Rebol |
Log(X => val, Base => 2.0) | Ada |
log(val, 2) | Python |
Log[2, val] | Mathematica |
frexp | C |
math.Log2 | Go |
divmod | Python, Ruby |
divMod | Haskell |
div ldiv lldiv | C |
IntInf.quotrem | SML |
floor | Common Lisp, Dylan |
/mod | Forth |
Div(12) | Go |
modulo of -3 / 2 is 1
% | Classic REXX, Perl, Perl6, Pike, Python, Ruby, Tcl |
%% | E |
\\ | Smalltalk |
mod | Ada, Common Lisp, Emacs Lisp, Haskell, Matlab, Prolog, SML |
Mod | Mathematica |
MOD | Modula-3 |
modulo | Dylan, Logo, Ruby |
rem | Prolog |
modulo of -3 / 2 is -1
% | Awk, B, C, C#, C++, CoffeeScript, E, F#, Go, Io, Java, JavaScript, PHP, Pliant, Yorick |
# | MUMPS |
mod | F#, Forth, Lua, OCaml, Oz, Pascal, PostScript, Prolog, XPath |
remainder | Logo, Ruby, Scheme |
rem | Ada, BCPL, Haskell, Matlab, Smalltalk |
// | Classic REXX, Rebol |
\\ | Eiffel |
trunc / round / floor / ceil | C, C++, Maple, Matlab |
truncate / round / floor / ceiling | Common Lisp, Haskell, Perl6, PostScript, Prolog, Scheme |
int / round / floor / ceil | CoffeeScript, JavaScript, Pike, Python |
int / round / / | Logo |
to_i, Integer() / round / floor / ceil | Ruby |
TRUNC / FORMAT / Floor / Ceil | Classic REXX |
Float'Truncation / Float'Rounding / Float'Floor / Float'Ceiling(13) | Ada |
/ round / floor / ceil | E, Io, Java, Lua, PHP, SML, Tcl |
/ Round / Floor / Ceiling | C# |
/ Round / Floor / Ceil | Oz |
/ round / floor / ceiling | Dylan, Emacs Lisp, PostScript, XPath |
/ ROUND / FLOOR / CEILING | Modula-3 |
/ rounded / floor / ceiling | Eiffel, Smalltalk |
int / / floor / ceil | F#, Perl |
int_of_float / / floor / ceil | F#, OCaml |
/ / floor / ceil | Lua, Yorick |
IntegerPart / Round / Floor / Ceiling | Mathematica |
/ Rounding / Floor / Ceiling | Ada |
to-integer / / / | Rebol |
/ fround / / | Forth |
math.Trunc / / math.Floor / math.Ceil | Go |
and / or / xor
& / | / ^ | C, C#, C++, CoffeeScript, E, Eiffel, Go, Java, JavaScript, Perl, PHP, Pike, Python, Ruby, Tcl |
& / | / ~ | Yorick |
& / | | YCP |
+& / +| / +^ | Perl6 |
.&. / .|. / xor(14) | Haskell |
&&& / ||| / ^^^ | F# |
and / or / xor | Ada, Forth, PostScript, Rebol |
land / lor / lxor | F#, OCaml |
logand / logior / logxor(15) | Common Lisp |
bitand / bitor / bitxor | Logo, Matlab |
BITAND / BITOR / BITXOR | Classic REXX |
BitAnd / BitOr / BitXor | Mathematica |
bitAnd / bitOr / bitXor | Smalltalk |
bitwiseAnd / bitwiseOr / bitwiseXor | Io |
/\ / \/ / xor | Prolog |
bitwise inversion
~ | C, C#, C++, CoffeeScript, Java, JavaScript, Perl, PHP, Pike, Python, Ruby, SML, Tcl, YCP |
~~~ | F# |
not | Ada, Eiffel, PostScript |
lnot | F#, OCaml |
lognot(16) | Common Lisp |
bitnot | Eiffel, Logo |
BitNot | Mathematica |
complement | Haskell, Rebol |
bitcmp | Matlab |
bitInvert | Smalltalk |
bitwiseComplement | Io |
invert | Forth |
\ | Prolog |
left shift / right shift / unsigned right shift
<< / >> / >>> | CoffeeScript, Java, JavaScript |
<< / >> | C, C#, C++, Go, Perl, PHP, Pike, Prolog, Python, Ruby, Tcl, YCP |
<<< / >>> | F# |
|<< / |>> | Eiffel |
lsl / lsr or asr | F#, OCaml |
bitshift | Matlab, PostScript |
bitShift | Smalltalk |
ashift lshift | Logo |
lshift / rshift | Forth |
shiftL / / shiftR | Haskell |
shiftLeft / shiftRight | Io |
Shift_Left / Shift_Right / Shift_Right_Arithmetic / Rotate_Left / Rotate_Right | Ada |
(ash x positive-integer) / (ash x negative-integer) / | Common Lisp |