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
]
}
}
[
69.69802489561697,
722.843882811923,
3.110759806340135,
1127.3906131390024,
29.394648720422644
]

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