A_YYYY . ", " . A_DD . " " . A_MMMM . " (" . A_DDD . ")" ;; current date A_Hour . ":" . A_Min . ":" . A_sec ;; current time A_ScreenWidth . " x " . A_ScreenHeight ;; screen resolution A_IPAddress1 ;; IP address of network adapter1 RegExReplace(A_MMMM,"Febr","Jan") ;; February -> January FileExist('calc.ahk') ;; file attributes DllCall("MulDiv", "Int",6, "Int",5, "Int",2, "Int") ;; call API functions VarSetCapacity(S,20) ;; reserve memory DllCall("msvcrt\sprintf","Str",S,"Str","0x%016I64X","Double",.0123456);S ;; hex form of float DllCall("RtlMoveMemory", DoubleP,S, Int64P,0x7fefffffffffffff, Uint,8); S ;; max double run(`calc) ;; run commands from file calc.clc asc('a') ;; ANSI code chr(98) ;; ANSI char x:=1;*(&x) ;; dereference, address -> ANSI code of digit 1 b(`01111111) ;; enter binary numbers msg(pi) ;; shows 63 digits of pi in MsgBox time() ;; time and date to copy to app time(`YDay) ;; today's day of the year mod(time(`YWeek),100) ;; week of the year sign(-9) ;; sign rand(1,6) ;; Repeated Enter => DICE c2f(37) ;; Centrigrade to Fahrenheit 189*lb_kg ;; 189 pounds = 85.729 Kg sqrt(2)**8 ;; ~16 fcmp(sqrt(2)**8,16,1) ;; ls bit is different from ls bit of 16 ldexp(3.25,2) ;; 3.25 * 2**2 frexp(13,e); e ;; 4: scale by 2**4 to get 13 into [0.5,1) atan2(-1,1)*deg ;; 135° sinh(asinh(.123)) ;; .123 cbrt(-27) ;; -3 quadratic(x,y, 1,-3,2) ;; 2 real roots msg(x,y) ;; root1 and root2 cubic(x,y,z,1,-2,-1,2) ;; 3 real roots list(assign(`r,x,y,z)) ;; assign them to vector r, list LCM(6,9) ;; leat common multiple = 18 GCD(6,9) ;; greatest common divisor = 3 xGCD(c,d,15,35); c*15+d*35 ;; = gcd = 5 Choose(90,5) ;; 44 million 90/5 lottery tickets needed to win Fib(6) ;; sixth Fibonacci number = 8 fac(5) ;; 5! = 120 isPrime(12345678911) ;; not a prime number list(pDivs("d",12345678911)) ;; 3643*3388877 modmul(12345678910125,2**60,1000) ;; huge product ends with 000 ModPow(1357924680,987654321,3388877) ;; = 2394902 (NO overflow!) uCmp(-1,99) ;; -1 ~= max unsigned MsMul(2**63,2**3) ;; 4 = 2**66 mod 2**64 MSb(b(`01111111)) ;; bit7 is leftmost set LSb(b(`010000000)) ;; bit8 is rightmost set e:='1/x+1/y'; x:=1; y:=2; eval(e) ;; evaluate "e" with current values of x, y f:='f1/f2'; call('f',100,4) ;; evaluate function 'f' with f1=100, f2=4 solve(`x,1,3,'x*(x-2)') ;; find x (=2) between 1 and 3, where x*(x-2) = 0 fmax(`x,.5,1.5,2,"x*(2-x)") ;; max of x*(2-x) between .5 and 2, start from x = 1.5 s:=0; for(`i,1,10,1,'s+=i*i') ;; =385 = 1**2+2**2+...+10**2 s:=0; i:=1; while('i<99','s+=1/i/i++') graph(1,101,-1,13);xtick(10);ytick(14) plot(array(`x,`i,0.1,10,0.1,'LnGamma(i)')) graph(1,50,0,25);xtick(5);ytick(5) plot(array(`x,`i,0.1,5,0.1,'Gamma(i)')) graph(1,41,-1,1);xtick(10);ytick(10) plot(array(`x,`i,-2,2,0.1,'erf(i)')) @(`x,seq(`x,0.1,2*pi,0.1),`cos) ;; cos(0)..cos(2pi) @(`y,seq(`y,0.1,2*pi,0.1),`sin) ;; sin(0)..sin(2pi) plotXY(X,Y) ;; ellipse (close previous graph beforehand) list(sort(`x,array(`x,`i,1,100,1,'rand(1,6)'))) list(primes(`p,999)) ;; prime numbers <= 999 list(pDivs(`d,prod(primes(`p,50)))) ;; prime factors of the product of small primes assign(`x,-1,0,1) ;; ploynomial x²-1 assign(`y,6,-5,1) ;; ploynomial x²-5x+6 pleval(y,3) ;; 0 list(plmul(`z,x,y)) ;; polynomial product = xª-5x³+5x²+5x-6 pldiv(`q,`r,z,x); list(@(q,q,`round,2)) ;; polynomial division, result rounded to 2 decimals r[3] := r[1] + r[2];; r_3 <-- 0 min(q) ;; -5, the smallest coefficient max(1,-2,3,-4) ;; 3 1+Deps ;; > 1 1+Deps/2 ;; = 1 plot(primes(`p,999)) ;; primes are almost linear increasing plot(diff(`y,array(`x,`i,-2,2,0.1,'erf(i)'))) ;; bell curve ~ differential of erf plot(@(`z,cumsum(`y,seq(`x,-1,.99,0.01)),'*',.01)) ;; parabola ~ integral of linear function BC(101,2) ;; unsigned binary -> decimal BC(12345) ;; octal -> decimal BC("abcd",32,16) ;; base 32 -> hex (13+12*32+11*32**2+10*32**3) x:='12AB'; bin2hex(&x,5) ;; hex stream form of memory content hex2bin(x,"4142313200"); x ;; write binary data to allocated memory for x fnext(0,0) ;; 0 fnext(0) ;; Dmin (2.25e-308) fnext(1) ;; 1.0000000000000002 x:=fnext(0);sin(x)/x ;; = 1 (right-limit) x:=fnext(1,1);abs(x**2-1)/(x-1) ;; = 2 (right-limit) x:=fnext(1,-1);abs(x**2-1)/(x-1) ;; =-2 (left limit) cot(fnext(0)) ;; cot(0) = infinity fformat(0.2) ;; show results in 2 decimal places pi+1 ;; 4.14 fformat() ;; default precision (0.16e) mode() ;; toggle RAD/DEG trigonometric domain sin(90) ;; 1 asin(1) ;; 90 degrees acot(2)+atan(2) ;; 90 degrees f2int(-118.625) ;; bits of a double int2f(-4585324127639830528) ;; double from its bits assign(`a,1,2,3,4,5);assign(`d,9,9,9,9,9,9);assign(`c,1,1,1,1,1);assign(`b,0,1,2,2,1,0) list(solve3(`x,a,d,c,b)) ;; solve a tridiagonal system plot(assign(`y,1,2,4,8,16)) ;; coarse exponential curve plot(upsample(`yy,assign(`y,1,2,4,8,16),19)) ;; smoothed exponential curve plot(assign(`y,1,0,1,0,1)) ;; saw-tooth plot(upsample(`yy,assign(`y,1,0,1,0,1),19)) ;; smooth graph (look @ endpoints!) list(CBget(`c)) ;; data from ClipBoard CBput(upsample(`yy,assign(`y,1,0,1,0,1),4),'%.6g`n') ;; Copy formatted interpolated data msg("a`na`tb;;") ;; special characters (new-line, tab)