You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
k/1.c

12 lines
917 B

#include<math.h> // ngn/k, (c) 2019-2022 ngn, GNU AGPLv3 - https://codeberg.org/ngn/k/raw/branch/master/LICENSE
#include"a.h"
A1(neg,
XZF(Nn=xn;I(xw<3&&minfZ(0,x)==-1<<(8<<xw)-1,x=cT[tH+xw](x))
Ay=xr>1?an(n,xt):x;SW(xt,C(tB,i(PD(n,xB),yb=-xb))C(tH,i(PD(n,xH),yh=-xh))C(tI,i(PD(n,xI),yi=-xi))C(tL,i(PD(n,xL),yl=-xl))D(i(PD(n,xF),yf=-xf)))x-y?x(y):y)
Xzc(az(-gl(x)))Xf(af(-gf(x)))XC(neg(cB(x)))XmMA(e1f(neg,x))et1(x))
A1(not,XmMA(e1f(not,x))XU(x(ai(x==au)))eql(xtsS?as(0):ai(0),x))
A1(nul,XmMA(e1f(nul,x))XU(x(ai(x==au)))XF(Ay=aB(xn);xe(i(xn,yb=xf!=xf);y))Xf(x(ai(*xF!=*xF)))eql(cn[xt],x))
A1(flr,XmMA(e1f(flr,x))XcC(K1("{`c$x+32*~\"A[\"'x}",x))XsS(cS(flr(str(x))))XzZ(x)XfF(Ay=an(xn,xt+tl-tf);xe(i(yn,yl=xf<0?(L)xf-(xf<(L)xf):(L)xf)y))et1(x))
#define h(k,f) A1(k,XfF(Ay=xr-1?an(xn,xt):x;i(PD(xn,xF),yf=f(xf));x-y?x(y):y)XmMA(e1f(k,x))k(N(cF(x))))
h(ksin,sin)h(kcos,cos)h(klog,log)h(kexp,exp)h(sqr,__builtin_sqrt)