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

Floats

Floats

Floats are a feature.

A data type that represents a non-integer number.


Languages with Floats include Java, JavaScript, Python, Perl, MySQL, JSON, Go, Swift, Haskell, Ada, Prolog, Clojure, Elixir, Erlang, Mathematica, Julia, Reason, ActionScript, awk, F#, Verilog, Eiffel, OCaml, CoffeeScript, Elm, D, GraphQL, VHDL, PostScript, Chapel, WebAssembly, XQuery, Idris, Applescript, VBScript, AMPL, Protocol Buffers, BlitzBasic, Agda, Coq, Monkey, AutoIt, GNU Octave, Zephir, Hy, TOML, Zig, Icon, Scilab, QML, QBasic, EDN, IDL, Boo, J, F*, Ceylon, Turtle, Io, SPARQL, SuperCollider, SystemVerilog, Opa, Cython, ClojureScript, Puppet, AutoHotkey, PL/pgSQL, Modelica, LiveScript, Ioke, Pig Latin, AspectJ, Thrift, Transact-SQL, Maxima, SourcePawn, Fennel, Ion, K, HLSL, Koka, Xtend, Unicon, Pony, Gosu, Felix, GLSL, LilyPond, Jule, Futhark, chaiscript, MiniD, BlitzMax, Cryptol, ooc, Nit, Whiley, Linden Scripting Language, GDScript, Stan, Fancy, POV-Ray SDL, OpenEdge ABL, Golo, Shen, monte, JSLT, Pawn, Earl Grey, parasail, Easytrieve, FloScript, Urbiscript, nimrod, AmbientTalk, CBOR data definition language, Flatline, Kal, PromQL, SARL, Croc, juttle, RAISE Specification Language, SquidConf

Example from Java, AspectJ:
// ([0-9][0-9_]*\.([0-9][0-9_]*)?|\.[0-9][0-9_]*)([eE][+\-]?[0-9][0-9_]*)?[fFdD]?|[0-9][eE][+\-]?[0-9][0-9_]*[fFdD]?|[0-9]([eE][+\-]?[0-9][0-9_]*)?[fFdD]|0[xX]([0-9a-fA-F][0-9a-fA-F_]*\.?|([0-9a-fA-F][0-9a-fA-F_]*)?\.[0-9a-fA-F][0-9a-fA-F_]*)[pP][+\-]?[0-9][0-9_]*[fFdD]?
Example from JavaScript:
// (\.[0-9]+|[0-9]+\.[0-9]*|[0-9]+)([eE][-+]?[0-9]+)? 80766866.0
Example from Python:
# (\d(?:_?\d)*\.(?:\d(?:_?\d)*)?|(?:\d(?:_?\d)*)?\.\d(?:_?\d)*)([eE][+-]?\d(?:_?\d)*)?
Example from Perl:
# (?i)(\d*(_\d*)*\.\d+(_\d*)*|\d+(_\d*)*\.\d+(_\d*)*)(e[+-]?\d+)?
Example from MySQL, Transact-SQL:
-- [0-9]+\.[0-9]*(e[+-]?[0-9]+)?
Example from JSON:
2.3
Example from Go:
// \d+(\.\d+[eE][+\-]?\d+|\.\d*|[eE][+\-]?\d+)
Example from Swift:
// [0-9][0-9_]*(\.[0-9_]+[eE][+\-]?[0-9_]+|\.[0-9_]*|[eE][+\-]?[0-9_]+)
Example from Haskell:
-- 0[xX]_*[\da-fA-F](_*[\da-fA-F])*_*[pP][+-]?\d(_*\d)*
Example from Ada:
-- [0-9_]+\.[0-9_]*
Example from Prolog:
% (\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?
Example from Clojure, Hy, Fennel:
; -?\d+\.\d+
Example from Elixir:
# \d(_?\d)*\.\d(_?\d)*([eE][-+]?\d(_?\d)*)?
Example from Erlang:
% [+-]?\d+.\d+
Example from Julia:
# (\d+((_\d+)+)?\.(?!\.)(\d+((_\d+)+)?)?|\.\d+((_\d+)+)?)([eEf][+-]?[0-9]+)?
Example from Reason:
// -?\d[\d_]*(.[\d_]*)?([eE][+\-]?\d[\d_]*)
Example from awk, CoffeeScript:
# [0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?
Example from F#:
// -?\d[\d_]*(.[\d_]*)?([eE][+\-]?\d[\d_]*)[fFmM]?
Example from Verilog, SystemVerilog:
// (\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[lL]?
Example from Eiffel:
-- ([0-9]+\.[0-9]*)|([0-9]*\.[0-9]+)
Example from Elm:
-- _?\d+\.(?=\d+)
Example from D:
// 0[xX]([0-9a-fA-F_]*\.[0-9a-fA-F_]+|[0-9a-fA-F_]+)[pP][+\-]?[0-9_]+[fFL]?[i]?
Example from VHDL:
-- (\d+\.\d*|\.\d+|\d+)E[+-]?\d+
Example from PostScript:
% (\-|\+)?([0-9]+\.?|[0-9]*\.[0-9]+|[0-9]+\.[0-9]*)((e|E)[0-9]+)?(?=[()<>\[\]{}/%\s])
Example from Chapel:
// (\d*\.\d+)([eE][+-]?[0-9]+)?i?
Example from Idris, Agda:
-- \d+[eE][+-]?\d+
Example from Applescript:
-- [-+]?(\d+\.\d*|\d*\.\d+)(E[-+][0-9]+)?
Example from VBScript:
' [0-9]+\.[0-9]*(e[+-]?[0-9]+)?
Example from AMPL:
# (\d+\.(?!\.)\d*|\.(?!.)\d+)([eE][+-]?\d+)?
Example from Protocol Buffers:
// (\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[LlUu]*
Example from Monkey:
' [0-9]+\.[0-9]*(?!\.)
Example from AutoIt, AutoHotkey:
; (\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?
Example from GNU Octave:
% (\d+\.\d*|\d*\.\d+)([eEf][+-]?[0-9]+)?
Example from Zephir, QML, SuperCollider:
// [0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?
Example from TOML, GDScript:
# (\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?j?
Example from Icon, Unicon:
# [+-]?[0-9]*\.([0-9]*)([Ee][+-]?[0-9]*)?
Example from Scilab:
// (\d+\.\d*|\d*\.\d+)([eEf][+-]?[0-9]+)?
Example from Boo:
# (\d+\.\d*|\d*\.\d+)([fF][+-]?[0-9]+)?
Example from J:
NB. _?\d+\.(?=\d+)
Example from Ceylon:
// \d{1,3}(_\d{3})+\.\d{1,3}(_\d{3})+[kMGTPmunpf]?
Example from Io:
// (\d+\.?\d*|\d*\.\d+)([eE][+-]?[0-9]+)?
Example from SPARQL:
# [+\-]?(\d+\.\d*[eE][+-]?\d+|\.?\d+[eE][+-]?\d+)
Example from Modelica:
// \d+(\.?\d*[eE][-+]?\d+|\.\d*)
Example from LiveScript:
# [0-9]+\.[0-9]+([eE][0-9]+)?[fd]?(?:[a-zA-Z_]+)?
Example from Pig Latin:
-- [0-9]*\.[0-9]+(e[0-9]+)?[fd]?
Example from Ion:
// http://amzn.github.io/ion-docs/docs/spec.html -0.12e4 // Type is float
Example from K:
/ ([0-9]*[.]?[0-9]+|[0-9]+[.]?[0-9]*)[eE][+-]?[0-9]+[ef]?
Example from Koka:
// [0-9]+\.[0-9]+([eE][\-+]?[0-9]+)?
Example from Felix:
// 0[xX]([0-9a-fA-F_]*\.[0-9a-fA-F_]+|[0-9a-fA-F_]+)[pP][+\-]?[0-9_]+[lLfFdD]?
Example from MiniD:
// ([0-9][0-9_]*)(?=[.eE])(\.[0-9][0-9_]*)?([eE][+\-]?[0-9_]+)?
Example from Whiley:
// [0-9]+\.[0-9]+
Example from Linden Scripting Language:
// (\d+\.\d*|\.\d+|\d+)[eE][+-]?\d*
Example from POV-Ray SDL:
// [0-9]*\.[0-9]+
Example from Golo:
# -?[\d_]*\.[\d_]*([eE][+-]?\d[\d_]*)?F?
exceptions-feature.html 路 floats-feature.html 路 garbage-collection-feature.html

View source

PLDB - Build the next great programming language 路 v2022 Day 33 Docs Build Acknowledgements Traffic Today Traffic Trends Mirrors GitHub feedback@pldb.com