Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Remove KRE's random int function

...

The math library provides a number of useful math functions as well as special functions for plane-angle conversions, digests, trigonometry, and great-circle calculations. More are added as needed. 

General

...

random

random(<num>) - generate a random number. The value is between 0 and the number given as an argument.

Code Block
themeConfluence
langjavascript
  r = math:random(999)

The given example will return random digits between 0 and 3 inclusive:

Code Block
themeConfluence
langjavascript
rule random_example {
  select when pageview ".*"
  pre{  
    r = math:random(3);
  }
  {
    notify("Random Number","r = #{r}") with sticky = true;
  }
}

...

Functionsexponent

exp(<num>) - return e (natural logrithm) raised to the <num>th power

...