Power
Inputs: i1
Outputs: o1
Emits messages with values equal to the power of the specified exponent represented by the number (value) regardless the time field of the message.
The Power
operator does not hold a message buffer on i1
, so it emits a modified version of the message through o1
right after it receives a message on i1
.
Parameters
id: The id of the operator
value: The exponent.
Usage
- TypeScript
- Python
- C++
- YAML
- Json
import { Program, Power } from "@rtbot-dev/rtbot";
const id = "id";
const value = 2.71;
const program = new Program();
program.addOperator(new Power(id, value));
import rtbot as rb
id = "id";
value = 2.71;
program = rb.Program()
program.addOperator(rb.Power(id, value))
#include "rtbot/Power.h"
auto id = "id";
auto value = 2.71;
auto op = Power<std::uint64_t, double>(id, value)
# minimal RtBot program
operators:
- type: Power
id: "id"
value: 2.71
{
"operators": [
{ "type": "Power", "id": "id", "value": 2.71 }
]
}