From 9da59c856d40d40caf91b697efe18f88a5921636 Mon Sep 17 00:00:00 2001 From: Julius Volz Date: Sat, 25 Jul 2020 13:34:57 +0200 Subject: [PATCH] Improve scalar literal format documentation (#7651) * Improve scalar literal format documentation Signed-off-by: Julius Volz * Address review comments Signed-off-by: Julius Volz * Fixup Signed-off-by: Julius Volz --- docs/querying/basics.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/querying/basics.md b/docs/querying/basics.md index 7c9507b2f..92f80a382 100644 --- a/docs/querying/basics.md +++ b/docs/querying/basics.md @@ -55,10 +55,23 @@ Example: ### Float literals -Scalar float values can be literally written as numbers of the form -`[-](digits)[.(digits)]`. +Scalar float values can be written as literal integer or floating-point numbers in the format (whitespace only included for better readability): + [-+]?( + [0-9]*\.?[0-9]+([eE][-+]?[0-9]+)? + | 0[xX][0-9a-fA-F]+ + | [nN][aA][nN] + | [iI][nN][fF] + ) + +Examples: + + 23 -2.43 + 3.4e-9 + 0x8f + -Inf + NaN ## Time series Selectors @@ -180,7 +193,7 @@ The same works for range vectors. This returns the 5-minute rate that ## Subquery -Subquery allows you to run an instant query for a given range and resolution. The result of a subquery is a range vector. +Subquery allows you to run an instant query for a given range and resolution. The result of a subquery is a range vector. Syntax: ` '[' ':' [] ']' [ offset ]`