diff --git a/cli/test.yaml b/cli/test.yaml index eb10681a..ee70767f 100644 --- a/cli/test.yaml +++ b/cli/test.yaml @@ -2647,9 +2647,16 @@ - name: multiply empty string args: - - '7 * ""' + - '(-9223372036854775808, -1, 0, 0.001, 0.999, 1, 7, 9223372036854775807) * ""' input: 'null' expected: | + null + null + null + "" + "" + "" + "" "" - name: multiply objects diff --git a/operator.go b/operator.go index 7f9abee1..73a548e0 100644 --- a/operator.go +++ b/operator.go @@ -436,7 +436,7 @@ func repeatString(s string, n float64) any { if n <= 0.0 || len(s) > 0 && n > float64(0x10000000/len(s)) || math.IsNaN(n) { return nil } - if n < 1.0 { + if int(n) < 1 { return s } return strings.Repeat(s, int(n))