I like to create and experiment with tools for thought and visualization with a special focus on the language system FORMWELT and its underlying 4-valued logic uFORM iFORM.
// slower than invNfromBase64() when inverting many numbers, because no straight parsing of quaternary numbers as BigInt(?)
// significantly faster than invNfromBase64() when inverting huge numbers, very close but not quite as fast as invQuat()
constbinN=quatToBin('3'+nStr);
constn=BigInt(binN);
constm=1n<<BigInt(binN.substr(2).length-1);// 1{0…len} from length of binary n
constresult=(n^(m|m-1n)).toString(4);// XOR with 1-series
returnresult.padStart(nStr.length,'0');
}
BigInt(quatToBin(n)).toString().length
Math.log2(quatToBin('3'+n))
quatToBin('3'+'0013').substr(2);
a===b
a===c
c=binInvNfromBase64(n)
b=invQuat(n)
a=invNfromBase64(n,4)
digitxN=(d,n)=>{
/* Builds a number from n x d digits (very slow!) */
letnum=0;
while(n>-1)num+=d*(10**n),n--;
returnnum;
}
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.