Skip to content

[BUG] maxall[] and friends return nonsense without input #9335

@yaisog

Description

@yaisog

Describe the bug

Some operators return unexpected results when used without input, e.g. [filter that can return nothing] +[maxall[]].
In particular,
sum[] - currently returns 0
product[] - currently returns 1
maxall[] - currently returns -Infinity
minall[] - currently returns Infinity
average[] - currently returns NaN
variance[] - currently returns NaN
standard-deviation[] - currently returns NaN

Expected behavior

I think that according to normal usage, all of these should return nothing in this situation.

A fix could be pretty straightforward, but would not be backwards compatible. Alternatively, we could add a parameter to each with a default value for such situations, but that is really ugly.

To Reproduce

  1. Go to tiddlywiki.com
  2. Go to $:/AdvancedSearch → Filter
  3. Enter +[maxall[]]
  4. Observe the result "-Infinity"

Screenshots

No response

TiddlyWiki Configuration

  • Version 5.3.8

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed, replicable bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions