← All procedures

algebra.pschedFactor

This function gives the factor of a rate in bytes per second (`psched_ratecfg_precompute__`). The kernel doubles a factor of 10^9 until the quotient by the rate fills 32 bits. At 125,000 bytes per second, `mult` is 4,194,304,000 and `shift` is 19.

CLI
Package
@procedures/algebra · README
Path
["algebra","pschedFactor"]
CLI
mark algebra pschedFactor --rate <number>
As data
{"$proc":["algebra","pschedFactor"],"input":{}}

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/algebra/register"; // registers its procedures

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["algebra","pschedFactor"], { rate: 1 });
console.log(JSON.stringify(result));

From the command line

$ mark algebra pschedFactor --rate <number>

As data, in a program

{ "$proc": ["algebra", "pschedFactor"], "input": { "rate": 1 } }

Input

FieldTypeRequiredDefaultDescription
ratenumberyes

Output

FieldTypeRequiredDefaultDescription
multnumberyes
shiftnumberyes
JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "rate": {
        "type": "number"
      }
    },
    "required": [
      "rate"
    ],
    "additionalProperties": false
  },
  "output": {
    "type": "object",
    "properties": {
      "mult": {
        "type": "number"
      },
      "shift": {
        "type": "number"
      }
    },
    "required": [
      "mult",
      "shift"
    ],
    "additionalProperties": {}
  }
}