Languages Features Calendar CSV Lists Blog About Sponsor Add Language
GitHub icon



Octals are a feature.

Base-8 number system, and uses the digits 0 to 7. Often represented by putting a "0" before the number (or -0 for negative octals). So 010 = 8, 0100 = 64.

Languages with Octals include Java, JavaScript, Python, Perl, Go, Swift, Haskell, Prolog, Elixir, Julia, Reason, F#, Verilog, Eiffel, OCaml, D, VHDL, PostScript, Chapel, Protocol Buffers, Coq, AutoIt, Hy, Zig, IDL, Boo, F*, SystemVerilog, Opa, Cython, Isabelle, Puppet, AutoHotkey, AspectJ, SourcePawn, HLSL, Felix, GLSL, Jule, Cryptol, ooc, Meson, Golo, Logtalk, Pawn, Earl Grey, FloScript, nimrod, CBOR data definition language

Example from Java, AspectJ:
// 0[0-7_]+[lL]?
Example from JavaScript:
// 0[oO]?[0-7]+n? 0o464063622
Example from Python:
# 0[oO](?:_?[0-7])+
Example from Perl:
# 0_?[0-7]+(_[0-7]+)*
Example from Go:
// 0[0-7]+
Example from Swift:
// 0o[0-7_]+
Example from Haskell:
-- 0[oO]_*[0-7](_*[0-7])*
Example from Prolog:
% 0o[0-7]+
Example from Elixir:
# 0o[0-7]+
Example from Julia:
# 0o[0-7]+((_[0-7]+)+)?
Example from Reason:
// 0[oO][0-7][0-7_]*
Example from F#:
// 0[oO][0-7][0-7_]*[uU]?[yslLn]?
Example from Verilog:
// ([0-9]+)|(\'o)[0-7]+
Example from Eiffel:
-- 0[cC][0-7]+
Example from D:
// 0[0-7_]+
Example from VHDL:
-- O"[0-7_]+"
Example from PostScript:
% [0-9]+\#(\-|\+)?([0-9]+\.?|[0-9]*\.[0-9]+|[0-9]+\.[0-9]*)((e|E)[0-9]+)?(?=[()<>\[\]{}/%\s])
Example from Chapel:
// 0[oO][0-7]+
Example from Protocol Buffers:
// 0[0-7]+[LlUu]*
Example from AutoIt, AutoHotkey:
; 0\d+
Example from Hy:
; 0[0-7]+j?
Example from Boo:
# 0\d+
Example from SystemVerilog:
// ([1-9][_0-9]*)?\s*\'[sS]?[oO]\s*[xXzZ?0-7][_xXzZ?0-7]*
Example from Felix:
// 0[0-7_]+([tTsSiIlLvV]|ll|LL|([iIuU])(8|16|32|64))?
Example from Jule:
Example from Golo:
# 0[0-7]+j?
hexadecimals-feature.html 路 octals-feature.html 路 line-comments-feature.html

View source

PLDB - Build the next great programming language 路 v2022 Day 33 Docs Build Acknowledgements Traffic Today Traffic Trends Mirrors GitHub