Top 1,000 Features Creators Resources Blog Explorer Download
GitHub icon

Binary Literals

< >
Example from 1 languages: JavaScript
// 0[bB][01]+n? 0b100110100000110011110010010
Example from 1 languages: Python
# 0[bB](?:_?[01])+
Example from 2 languages: Java, AspectJ
// 0[bB][01][01_]*[lL]?
Example from 1 languages: Perl
# 0b[01]+(_[01]+)*
Example from 1 languages: Swift
// 0b[01_]+
Example from 1 languages: Haskell
-- 0[bB]_*[01](_*[01])*
Example from 1 languages: Elixir
# 0b[01]+
Example from 1 languages: Julia
# 0b[01]+((_[01]+)+)?
Example from 1 languages: Prolog
% 0b[01]+
Example from 3 languages: Reason, Croc, MiniD
// 0[bB][01][01_]*
Example from 1 languages: MySQL
-- b'[01]+'
Example from 1 languages: D
// 0[Bb][01_]+
Example from 1 languages: F#
// 0[bB][01][01_]*[uU]?[yslLn]?
Example from 1 languages: Chapel
// 0[bB][01]+
Example from 1 languages: VHDL
-- B"[01_]+"
Example from 1 languages: Verilog
// ([0-9]+)|(\'b)[01]+
Example from 1 languages: Eiffel
-- 0[bB][01]+
Example from 1 languages: C3
0b110011
Example from 1 languages: Ceylon
// \$([01]{4})(_[01]{4})+
Example from 1 languages: SystemVerilog
// ([1-9][_0-9]*)?\s*\'[sS]?[bB]\s*[xXzZ?01][_xXzZ?01]*
Example from 1 languages: Felix
// 0[Bb][01_]+([tTsSiIlLvV]|ll|LL|([iIuU])(8|16|32|64))?
Example from 1 languages: K
/ [01]+b
Example from 1 languages: Whiley
// [01]+b
Example from 1 languages: Monkey
' \%[10]+
Example from 1 languages: Jule
0b0001010101
Example from 1 languages: Speedie
|| num = 0b010101
Example from 1 languages: Aardvark
`2_101` would evaluate as a binary number.
*

Languages with Binary Literals include JavaScript, Python, Java, Perl, Swift, Haskell, Elixir, Julia, Prolog, Zig, Reason, MySQL, D, OCaml, F#, Coq, Chapel, VHDL, F*, Verilog, Eiffel, Opa, C3, Futhark, Ceylon, SystemVerilog, NumPy, Felix, AspectJ, K, ooc, Isabelle, Logtalk, BlitzMax, Whiley, Monkey, BlitzBasic, Earl Grey, Croc, Jule, FloScript, MiniD, Savi, Speedie, parasail, Aardvark, nimrod, CBOR data definition language

*

Languages without Binary Literals include progsbase

*

View all concepts with or missing a hasBinaryNumbers measurement

*

Read more about Binary Literals on the web: 1.

View source

- Build the next great programming language About Acknowledgements Extensions Day 630 Donate feedback@pldb.io