diff --git a/docs/src/manpage.md b/docs/src/manpage.md index e7327a694..55b50c5ac 100644 --- a/docs/src/manpage.md +++ b/docs/src/manpage.md @@ -2682,10 +2682,10 @@ FUNCTIONS FOR FILTER/PUT (class=arithmetic #args=2) Subtraction, with integer-to-integer overflow. ./ - (class=arithmetic #args=2) Integer division; not pythonic. + (class=arithmetic #args=2) Integer division, rounding toward zero. / - (class=arithmetic #args=2) Division. Integer / integer is floating-point. + (class=arithmetic #args=2) Division. Integer / integer is integer when exact, else floating-point: e.g. 6/3 is 2 but 6/4 is 1.5. // (class=arithmetic #args=2) Pythonic integer division, rounding toward negative. @@ -2727,7 +2727,7 @@ FUNCTIONS FOR FILTER/PUT (class=boolean #args=2) Absent-coalesce operator. $a ?? 1 evaluates to 1 if $a isn't defined in the current record. ??? - (class=boolean #args=2) Absent-coalesce operator. $a ?? 1 evaluates to 1 if $a isn't defined in the current record, or has empty value. + (class=boolean #args=2) Absent/empty-coalesce operator. $a ??? 1 evaluates to 1 if $a isn't defined in the current record, or has empty value. ^ (class=arithmetic #args=2) Bitwise XOR. @@ -3134,5 +3134,5 @@ SEE ALSO - 2022-01-30 MILLER(1) + 2022-02-01 MILLER(1) diff --git a/docs/src/manpage.txt b/docs/src/manpage.txt index 456700526..b06bf09b9 100644 --- a/docs/src/manpage.txt +++ b/docs/src/manpage.txt @@ -2661,10 +2661,10 @@ FUNCTIONS FOR FILTER/PUT (class=arithmetic #args=2) Subtraction, with integer-to-integer overflow. ./ - (class=arithmetic #args=2) Integer division; not pythonic. + (class=arithmetic #args=2) Integer division, rounding toward zero. / - (class=arithmetic #args=2) Division. Integer / integer is floating-point. + (class=arithmetic #args=2) Division. Integer / integer is integer when exact, else floating-point: e.g. 6/3 is 2 but 6/4 is 1.5. // (class=arithmetic #args=2) Pythonic integer division, rounding toward negative. @@ -2706,7 +2706,7 @@ FUNCTIONS FOR FILTER/PUT (class=boolean #args=2) Absent-coalesce operator. $a ?? 1 evaluates to 1 if $a isn't defined in the current record. ??? - (class=boolean #args=2) Absent-coalesce operator. $a ?? 1 evaluates to 1 if $a isn't defined in the current record, or has empty value. + (class=boolean #args=2) Absent/empty-coalesce operator. $a ??? 1 evaluates to 1 if $a isn't defined in the current record, or has empty value. ^ (class=arithmetic #args=2) Bitwise XOR. @@ -3113,4 +3113,4 @@ SEE ALSO - 2022-01-30 MILLER(1) + 2022-02-01 MILLER(1) diff --git a/docs/src/reference-dsl-builtin-functions.md b/docs/src/reference-dsl-builtin-functions.md index 427420ea6..d8ea5c39e 100644 --- a/docs/src/reference-dsl-builtin-functions.md +++ b/docs/src/reference-dsl-builtin-functions.md @@ -184,14 +184,14 @@ pow (class=arithmetic #args=2) Exponentiation. Same as **, but as a function. ### \./
-./  (class=arithmetic #args=2) Integer division; not pythonic.
+./  (class=arithmetic #args=2) Integer division, rounding toward zero.
 
### /
-/  (class=arithmetic #args=2) Division. Integer / integer is floating-point.
+/  (class=arithmetic #args=2) Division. Integer / integer is integer when exact, else floating-point: e.g. 6/3 is 2 but 6/4 is 1.5.
 
@@ -339,7 +339,7 @@ pow (class=arithmetic #args=2) Exponentiation. Same as **, but as a function.
### ???
-???  (class=boolean #args=2) Absent-coalesce operator. $a ?? 1 evaluates to 1 if $a isn't defined in the current record, or has empty value.
+???  (class=boolean #args=2) Absent/empty-coalesce operator. $a ??? 1 evaluates to 1 if $a isn't defined in the current record, or has empty value.
 
diff --git a/internal/pkg/dsl/cst/builtin_function_manager.go b/internal/pkg/dsl/cst/builtin_function_manager.go index b94c701de..4e908ff6c 100644 --- a/internal/pkg/dsl/cst/builtin_function_manager.go +++ b/internal/pkg/dsl/cst/builtin_function_manager.go @@ -112,7 +112,7 @@ func makeBuiltinFunctionLookupTable() []BuiltinFunctionInfo { { name: "/", class: FUNC_CLASS_ARITHMETIC, - help: `Division. Integer / integer is floating-point.`, + help: `Division. Integer / integer is integer when exact, else floating-point: e.g. 6/3 is 2 but 6/4 is 1.5.`, binaryFunc: bifs.BIF_divide, }, @@ -161,7 +161,7 @@ func makeBuiltinFunctionLookupTable() []BuiltinFunctionInfo { { name: "./", class: FUNC_CLASS_ARITHMETIC, - help: `Integer division; not pythonic.`, + help: `Integer division, rounding toward zero.`, binaryFunc: bifs.BIF_dot_divide, }, @@ -361,7 +361,7 @@ func makeBuiltinFunctionLookupTable() []BuiltinFunctionInfo { { name: "???", class: FUNC_CLASS_BOOLEAN, - help: `Absent-coalesce operator. $a ?? 1 evaluates to 1 if $a isn't defined in the current record, or has empty value.`, + help: `Absent/empty-coalesce operator. $a ??? 1 evaluates to 1 if $a isn't defined in the current record, or has empty value.`, binaryFunc: BinaryShortCircuitPlaceholder, }, diff --git a/man/manpage.txt b/man/manpage.txt index 456700526..b06bf09b9 100644 --- a/man/manpage.txt +++ b/man/manpage.txt @@ -2661,10 +2661,10 @@ FUNCTIONS FOR FILTER/PUT (class=arithmetic #args=2) Subtraction, with integer-to-integer overflow. ./ - (class=arithmetic #args=2) Integer division; not pythonic. + (class=arithmetic #args=2) Integer division, rounding toward zero. / - (class=arithmetic #args=2) Division. Integer / integer is floating-point. + (class=arithmetic #args=2) Division. Integer / integer is integer when exact, else floating-point: e.g. 6/3 is 2 but 6/4 is 1.5. // (class=arithmetic #args=2) Pythonic integer division, rounding toward negative. @@ -2706,7 +2706,7 @@ FUNCTIONS FOR FILTER/PUT (class=boolean #args=2) Absent-coalesce operator. $a ?? 1 evaluates to 1 if $a isn't defined in the current record. ??? - (class=boolean #args=2) Absent-coalesce operator. $a ?? 1 evaluates to 1 if $a isn't defined in the current record, or has empty value. + (class=boolean #args=2) Absent/empty-coalesce operator. $a ??? 1 evaluates to 1 if $a isn't defined in the current record, or has empty value. ^ (class=arithmetic #args=2) Bitwise XOR. @@ -3113,4 +3113,4 @@ SEE ALSO - 2022-01-30 MILLER(1) + 2022-02-01 MILLER(1) diff --git a/man/mlr.1 b/man/mlr.1 index 52cd18b35..c1ad0f6bf 100644 --- a/man/mlr.1 +++ b/man/mlr.1 @@ -2,12 +2,12 @@ .\" Title: mlr .\" Author: [see the "AUTHOR" section] .\" Generator: ./mkman.rb -.\" Date: 2022-01-30 +.\" Date: 2022-02-01 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" -.TH "MILLER" "1" "2022-01-30" "\ \&" "\ \&" +.TH "MILLER" "1" "2022-02-01" "\ \&" "\ \&" .\" ----------------------------------------------------------------- .\" * Portability definitions .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -4320,7 +4320,7 @@ Int-valued example: '$n=floor(20+urand()*11)'. .RS 0 .\} .nf - (class=arithmetic #args=2) Integer division; not pythonic. + (class=arithmetic #args=2) Integer division, rounding toward zero. .fi .if n \{\ .RE @@ -4329,7 +4329,7 @@ Int-valued example: '$n=floor(20+urand()*11)'. .RS 0 .\} .nf - (class=arithmetic #args=2) Division. Integer / integer is floating-point. + (class=arithmetic #args=2) Division. Integer / integer is integer when exact, else floating-point: e.g. 6/3 is 2 but 6/4 is 1.5. .fi .if n \{\ .RE @@ -4455,7 +4455,7 @@ Int-valued example: '$n=floor(20+urand()*11)'. .RS 0 .\} .nf - (class=boolean #args=2) Absent-coalesce operator. $a ?? 1 evaluates to 1 if $a isn't defined in the current record, or has empty value. + (class=boolean #args=2) Absent/empty-coalesce operator. $a ??? 1 evaluates to 1 if $a isn't defined in the current record, or has empty value. .fi .if n \{\ .RE diff --git a/todo.txt b/todo.txt index fc68f0e5b..41ad4345f 100644 --- a/todo.txt +++ b/todo.txt @@ -15,10 +15,9 @@ RELEASES k format/unformat k split k slwin & shift-lead -* plan 6.2.0 k 0o.. octal literals in the DSL +* plan 6.2.0 ? YAML --> more badges -- ? ================================================================ FEATURES