Questions Concepts
GitHub icon


Integers - language feature

< >
Example from Java, AspectJ, Pizza, Oracle Java, Deesel:
// 0|[1-9][0-9_]*[lL]?
Example from Python, Ruby, Speedie:
pldb = 80766866
Example from C, C++, C#, Objective-C, Tick C:
int pldb = 80766866;
Example from SQL, Eiffel, Transact-SQL:
-- [0-9]+
Example from Perl:
# \d+(_\d+)*
Example from MySQL:
-- [0-9]+(?=[^0-9a-z$_\u0080-\uffff])
Example from Go:
i, j := 42, 2701
Example from Swift:
// [0-9][0-9_]*
Example from Ada:
-- [0-9_]+
Example from Haskell:
-- \d(_*\d)*
Example from Clojure, Hy, Fennel:
; -?\d+
Example from Prolog, CLPR, GAEA, Progol:
% \d\d?\'[a-zA-Z0-9]+
Example from Bash:
Example from Elixir:
# \d(_?\d)*
Example from Erlang:
% [+-]?(?:[2-9]|[12][0-9]|3[0-6])#[0-9a-zA-Z]+
Example from Verilog:
// ([0-9]+)|(\'d)[0-9]+
Example from Reason:
// \d[\d_]*
Example from awk, CoffeeScript, bawk:
# [0-9]+
Example from F#:
// \d[\d_]*[uU]?[yslLnQRZINGmM]?
Example from Elm:
-- _?\d+
Example from D:
// (0|[1-9][0-9_]*)([LUu]|Lu|LU|uL|UL)?
Example from VHDL:
-- \d{1,2}#[0-9a-f_]+#?
Example from PostScript:
% (\-|\+)?[0-9]+(?=[()<>\[\]{}/%\s])
// [0-9]+
Example from Forth:
\ (\#|%|&|\-|\+)?[0-9]+
Example from Applescript:
-- [-+]?\d+
Example from VBScript, Monkey:
' [0-9]+
Example from Idris, Agda:
-- \d+
Example from ABAP:
* [0-9]+
Example from Protocol Buffers:
// \d+[LlUu]*
Example from AMPL:
# \d+([eE][+-]?\d+)?
Example from TOML:
# \d{4}-\d{2}-\d{2}(?:T| )\d{2}:\d{2}:\d{2}(?:Z|[-+]\d{2}:\d{2})
Example from J:
NB. _?\d+
Example from AutoIt, AutoHotkey:
; \d+
Example from GNU Octave:
% \d+
Example from Icon, Unicon:
# \b([+-]?[0-9]+[KMGTPkmgtp]?)\b
// \d+
Example from Ceylon:
// \d{1,3}(_\d{3})+[kMGTP]?
Example from Boo:
# \d+
Example from SPARQL:
# [+\-]?\d+
Example from SystemVerilog:
// ([1-9][_0-9]*)?\s*\'[sS]?[dD]\s*[xXzZ?0-9][_xXzZ?0-9]*
Example from MiniD, Croc:
// ([0-9][0-9_]*)(?![.eE])
Example from C3:
int x = 314159;
Example from LiveScript:
# [0-9]+(~[0-9a-z]+)?(?:[a-zA-Z_]+)?
Example from Pig Latin:
-- [0-9]+L?
Example from Golo:
# -?\d[\d_]*
Example from Ion:
// // A null int value 0 // Zero. Surprise! -0 // ...the same value with a minus sign 123 // A normal int -123 // Another negative int 0xBeef // An int denoted in hexadecimal 0b0101 // An int denoted in binary 1_2_3 // An int with underscores 0xFA_CE // An int denoted in hexadecimal with underscores 0b10_10_10 // An int denoted in binary with underscores
Example from K:
/ [0-9]+[ihtuv]
Example from Ragel:
# [+-]?[0-9]+
Example from Felix:
// (0|[1-9][0-9_]*)([tTsSiIlLvV]|ll|LL|([iIuU])(8|16|32|64))?
Example from Jule:
12345 0b0001010101 0455 0xDFF90
Example from GDScript:
# \d+j?
Example from Cyber:
count = 0

Languages with Integers include Java, JavaScript, Python, C, SQL, C++, Perl, Ruby, C#, MySQL, JSON, Go, Swift, Ada, Haskell, TypeScript, Julia, Clojure, Prolog, Bash, Objective-C, Mathematica, Elixir, Erlang, ActionScript, Verilog, Reason, awk, CoffeeScript, F#, Elm, Eiffel, OCaml, D, GraphQL, VHDL, XQuery, PostScript, Chapel, WebAssembly, Forth, Applescript, VBScript, Idris, ABAP, Protocol Buffers, AMPL, sed, Coq, Monkey, BlitzBasic, Agda, Zig, TOML, J, AutoIt, Hy, Lean, GNU Octave, Zephir, Icon, Scilab, QML, Pony, EDN, Io, Opa, IDL, Ceylon, JSON5, Boo, QBasic, Turtle, F*, SPARQL, SystemVerilog, SuperCollider, Cython, POV-Ray SDL, PL/pgSQL, ClojureScript, MiniD, C3, Puppet, Ioke, Alloy, LiveScript, Modelica, AutoHotkey, Speedie, Pig Latin, Thrift, Transact-SQL, AspectJ, Maxima, Golo, Croc, Fennel, Ion, K, janet, SourcePawn, Koka, Ragel, Xtend, HLSL, Unicon, Gosu, HOPE, GLSL, Futhark, Felix, Jule, chaiscript, Pizza, Cryptol, BlitzMax, Nit, clay, Linden Scripting Language, GDScript, JSONiq, Whiley, Fancy, Meson, Stan, JSON with Comments, OpenEdge ABL, Shen, Superjson, Earl Grey, Cyber, monte, JSLT, Redcode, Jsonnet, Hocon, Uniform eXchange Format, Pawn, Kal, JS++, Notation3, parasail, BALGOL, Easytrieve, FloScript, wah, Flatline, Boogie, CLPR, Urbiscript, nimrod, AmbientTalk, CBOR data definition language, Procfile, Spice, hecl, PromQL, SARL, Oracle Java, boa, Deesel, RQL, juttle, RAISE Specification Language, Friendly Enough Expression Language, Tick C, bawk, GAEA, Progol

Languages without Integers include progsbase

This question asks: Does this language have a syntax and type for integers?

Read more about Integers on the web: 1.

HTML of this page generated by Features.ts

View source

- Build the next great programming language Search Add Language Features Creators Resources About Blog Acknowledgements Queries Stats Sponsor Traffic Traffic Today Day 305 Logout