Skip to content

Enhance randomNumber() function #3143

Description

@tfmorris

The randomNumber() function currently takes two Number arguments, converts them to integers and returns a random number in the open interval.

Proposed solution

I think the following changes would improve the function:

  • shorten the name to just random()
  • create a 0-arg version which returns a Double in the interval 0.0 - 1.0
  • provide two alternatives for the 2-arg version which return either an Long or a Double, depending on type of the parameters which are passed in

Alternatives considered

  • the 2-arg integer version could have a different name like randint a la Python
  • a variant that accepts a seed value could be useful for those who want reproducible results

Metadata

Metadata

Assignees

Labels

Priority: LowIndicates less critical issues that can be dealt with at a later stageType: Feature RequestIdentifies requests for new features or enhancements. These involve proposing new improvements.grelThe default expression language, GREL, could be improved in many ways!

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions