DKL9 GitList
Repositories
DKL9 home
rtensor
Code
Commits
Branches
Tags
Search
Tree:
50fbef0
Branches
Tags
master
rtensor
rtensor_common.js
Move code around to (hopefully) fix webpage
dkl9
commited
50fbef0
at 2023-198 14:54:43
rtensor_common.js
Blame
History
Raw
"use strict"; // operator text export const OPS = [ "+", "-", "*", "/", "^", "\\", "==", "-/", ",", "<", "=>", "=", "..", ]; // stringify a vecalc value for presentation export function fts(v) { if (v == null) { return "nonexistent"; } else if (v.constructor === Array) { switch (v.length) { case 0: return "[ ]"; default: return "[" + v.map(x => fts(x)).join(", ") + "]"; } } else if (v.constructor.name === "MathsFunc" || v.constructor === Function) { return "function"; } else if (v.constructor === null) { return "null"; } else { return v.toString(); } } export function ioLog(t) { const outp = document.createElement("p"); outp.innerText = t; iol.append(outp); return outp; }