mirror of
https://github.com/litruv/picoGraph.git
synced 2026-07-24 02:36:04 +10:00
- Created test_cart.p8 with basic drawing functionality and a print statement. - Created test_unix.p8 with a simple initialization function.
42 lines
961 B
JavaScript
42 lines
961 B
JavaScript
import { createNodeModule } from "../../nodeTypes.js";
|
|
|
|
/**
|
|
* Divides one numeric value by another.
|
|
*/
|
|
export const mathDivideNode = createNodeModule(
|
|
{
|
|
id: "math_divide",
|
|
title: "Divide",
|
|
category: "Math",
|
|
description: "Divide one number by another (floating point division).",
|
|
searchTags: ["divide", "division", "math", "slash", "number", "/"],
|
|
inputs: [
|
|
{
|
|
id: "a",
|
|
name: "A",
|
|
direction: "input",
|
|
kind: "number",
|
|
defaultValue: 0,
|
|
},
|
|
{
|
|
id: "b",
|
|
name: "B",
|
|
direction: "input",
|
|
kind: "number",
|
|
defaultValue: 1,
|
|
},
|
|
],
|
|
outputs: [
|
|
{ id: "res", name: "Result", direction: "output", kind: "number" },
|
|
],
|
|
properties: [],
|
|
},
|
|
{
|
|
evaluateValue: ({ resolveValueInput }) => {
|
|
const a = resolveValueInput("a", "0");
|
|
const b = resolveValueInput("b", "1");
|
|
return `(${a}) / (${b})`;
|
|
},
|
|
}
|
|
);
|