@nodescript/stdlib
Version:
Standard Node Definitions
23 lines (22 loc) • 506 B
JavaScript
export const module = {
version: '1.0.3',
moduleName: 'Math / Log',
description: `
Computes the logarithm of specified value.
`,
keywords: ['logarithm'],
params: {
value: {
schema: { type: 'number' },
},
base: {
schema: { type: 'number', default: 2 },
},
},
result: {
schema: { type: 'number' },
}
};
export const compute = params => {
return Math.log(params.value) / Math.log(params.base);
};