Skip to content

More functions #56

@EgorBron

Description

@EgorBron

Some ideas of functions to add:

  • rand(expr...) random number generator. If passed:
    • no arguments -- acts as Random.nextDouble();
    • one argument -- selects a number between 0 and given expression result;
    • two and more arguments -- selects a random expression from given
  • randRange(expr start, expr end, expr step) RNG in range. Selects a number from start (inclusive) to end (exclusive) utilizing step to transform numbers.
  • avg(expr...)/min(expr...)/max(expr...) calculates average/minimal/maximal value of expressions. I think they should be in the library by default.
  • nthrt(expr, expr) get root of nth power. The first expression is the one to extract the root from, and the second is the target power.

I would create a PR soon, but firstly I want to hear your opinion on that idea.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions