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
]
}
}
[
6.430995033085899,
1995.2096976703597,
190.03044081053156,
6.754363827562182,
675.3631068552453
]

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"
]
}