generators.dependsOnLibm
This function tells if the numbers of a family use `Math.exp`, `Math.log` or `Math.pow`. The result of those functions can change between JavaScript engines. Thus such a family has the same numbers only on one platform.
CLI- Package
- @procedures/generators · README
- Path
["generators","dependsOnLibm"]- CLI
mark generators dependsOnLibm --spec <any>- As data
{"$proc":["generators","dependsOnLibm"],"input":{}}
Use it
In TypeScript
import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/generators/register"; // registers its procedures
const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["generators","dependsOnLibm"], { spec: "<spec>" });
console.log(JSON.stringify(result));From the command line
$ mark generators dependsOnLibm --spec <any>
As data, in a program
{
"$proc": ["generators", "dependsOnLibm"],
"input": { "spec": "<spec>" }
}Input
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
spec | any | yes |
Output
The schema does not list fields (boolean).
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"spec": {
"$ref": "#/definitions/__schema0"
}
},
"required": [
"spec"
],
"additionalProperties": false,
"definitions": {
"__schema0": {
"anyOf": [
{
"type": "object",
"properties": {
"family": {
"type": "string",
"const": "beta"
},
"a": {
"anyOf": [
{
"type": "number"
},
{
"type": "array",
"items": [
{
"type": "number"
},
{
"type": "number"
}
],
"additionalItems": {},
"minItems": 2,
"maxItems": 2
}
]
},
"b": {
"anyOf": [
{
"type": "number"
},
{
"type": "array",
"items": [
{
"type": "number"
},
{
"type": "number"
}
],
"additionalItems": {},
"minItems": 2,
"maxItems": 2
}
]
}
},
"required": [
"family",
"a",
"b"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"family": {
"type": "string",
"const": "lognormal"
},
"mu": {
"anyOf": [
{
"type": "number"
},
{
"type": "array",
"items": [
{
"type": "number"
},
{
"type": "number"
}
],
"additionalItems": {},
"minItems": 2,
"maxItems": 2
}
]
},
"sigma": {
"anyOf": [
{
"type": "number"
},
{
"type": "array",
"items": [
{
"type": "number"
},
{
"type": "number"
}
],
"additionalItems": {},
"minItems": 2,
"maxItems": 2
}
]
}
},
"required": [
"family",
"mu",
"sigma"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"family": {
"type": "string",
"const": "mixture"
},
"parts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"weight": {
"type": "number"
},
"part": {
"allOf": [
{
"$ref": "#/definitions/__schema0"
}
]
}
},
"required": [
"weight",
"part"
],
"additionalProperties": {}
}
}
},
"required": [
"family",
"parts"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"family": {
"type": "string",
"const": "pareto"
},
"scale": {
"anyOf": [
{
"type": "number"
},
{
"type": "array",
"items": [
{
"type": "number"
},
{
"type": "number"
}
],
"additionalItems": {},
"minItems": 2,
"maxItems": 2
}
]
},
"shape": {
"anyOf": [
{
"type": "number"
},
{
"type": "array",
"items": [
{
"type": "number"
},
{
"type": "number"
}
],
"additionalItems": {},
"minItems": 2,
"maxItems": 2
}
]
}
},
"required": [
"family",
"scale",
"shape"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"family": {
"type": "string",
"const": "recorded"
},
"values": {
"type": "array",
"items": {
"type": "number"
}
}
},
"required": [
"family",
"values"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"family": {
"type": "string",
"const": "zipf"
},
"n": {
"type": "number"
},
"exponent": {
"anyOf": [
{
"type": "number"
},
{
"type": "array",
"items": [
{
"type": "number"
},
{
"type": "number"
}
],
"additionalItems": {},
"minItems": 2,
"maxItems": 2
}
]
}
},
"required": [
"family",
"n",
"exponent"
],
"additionalProperties": {}
}
]
}
}
},
"output": {
"type": "boolean"
}
}