{
"id": "fn-math-subtract",
"dataComponent": "math",
"heading": {
"title": "subtract",
"badges": [
"PARTIAL"
]
},
"synopsis": "Subtracts one number (or array) from another.",
"codeBlocks": [
"extend(\"math\")\\n\\n# Direct\\nsput( math:subtract(10, 3) ) // 7\\n\\n# Partial\\nsub5 = math:subtract(5)\\nsput( sub5(2) ) // 2\\nsput( sub5(9) ) // -4\\n\\n# Placeholder\\nminus20 = math:subtract(_, 20)\\nsput( minus20(50) ) // 30\\nsput( minus20(5) ) // -15"
],
"notes": [
"math:subtract(a, b) returns a - b. If called with only one argument, it returns a partial function waiting for the second number.",
"Using '_' lets you skip the first parameter, while providing the second immediately. Then the returned partial function expects just the first parameter.",
"If an array is used for either argument, each element of that array is subtracted by the single integer from the other argument (if supported by your bridging logic)."
]
}