Skip to main content

Math functions

pow

Commentary​

added in 0.6.12

Raises base to the power of exp. You can also use this function through an infix math expression.


Examples​

Raising literal numbers​

Use literal numbers to perform a static calculation.

{
"_gen": "pow",
"base": 5,
"exp": 2
}
[
25
]

Raising function calls​

Optionally, use function calls that return numbers to perform dynamic calculations.

{
"_gen": "pow",
"base": {
"_gen": "normalDistribution",
"mean": 5,
"sd": 2
},
"exp": {
"_gen": "uniformDistribution",
"bounds": [
3,
5
]
}
}
[
773.612163321922,
30.287600717225985,
453.3960308931327,
10171.11625068985,
4307.992258077343
]

Specification​

JSON schema​

{
"type": "object",
"properties": {
"base": {
"oneOf": [
{
"type": "number"
},
{
"type": "object",
"properties": {
"_gen": {
"type": "string"
}
},
"required": [
"_gen"
]
}
]
},
"exp": {
"oneOf": [
{
"type": "number"
},
{
"type": "object",
"properties": {
"_gen": {
"type": "string"
}
},
"required": [
"_gen"
]
}
]
}
},
"required": [
"base",
"exp"
]
}