08/18/2018, 02:54 AM
(08/17/2018, 06:39 PM)Xorter Wrote: Okay, now it works because of the complements:
Code:xorb(x,y,b)={x=if(x<0,b^h+x,x);y=if(y<0,b^h+y,y);z=sum(k=1,h+blength(max(x,y),b),b^(k-1)*mod(if(x==0,0,iferr(Vecrev(digits(floor(x*b^h),b))[k],err,0))+if(y==0,0,iferr(Vecrev(digits(floor(y*b^h),b))[k],err,0)),b))/b^h*1.0;if(z>b^(h-1),return(z-b^h),return(z));};
I have tested on the complex interval [[-3;3];[-3i;3i]] but triads are not found.
But what about using natural logarithm of quaternionic base units, like i, j, k? Well, the logarithm makes multiplication from the addition, like this way:
log i + log j = log ij = log k
So, can (log i; log j; log k) be a triad?
(Let us notice that log i[x] not equals to i[x](pi/2 + 2npi) in this context.)
Quaternions are non-commutative, and xoring is supposed to be commutative, but idk if you are okay with that.