Version 3.5 is available for testing. More than a thousand lines are changed/added since the last release, so there could be some bugs. You can download the
Popup AHK calculator v.3.5
Works with AHK 1.0.47.04 ... 1.0.47.06
Includes lexiKos' lowlevel functions (
http://www.autohotkey.com/forum/viewtopic.php?t=26300)
Measure width of all text/header for consitent display in any font, fontsize and dpi settings
dllcall("GetDialogBaseUnits","UInt") --> pixels for tabstop (dpi dependent)
New user interface: Expression imput (~Paper) on top, results below.
-- Enter evaluates current line.
---- In last line: insert blank line below.
-- Ctrl-Enter: insert newline char
-- Shift-Enter: execute (multiline, partial line) selection
Ctrl-= duplicate current line
ESC clear current line
Ctrl-Z undo/redo last edit
Context menu in calculator window (right click, Appskey):
--- Help,Load,Save,Hide,Exit
--- duplicate_line,clear_line,select_line,select_all,undo
--- cut,copy,paste,delete
Removed Alt-A/U/E history editing (history is now directly editable)
New context menu and tray menu items, shortcuts:
-- Alt-E: appEnd-to-history
-- Alt-S: Save selection
-- Alt-W: Write history to file.
Tab: insert line-end from first/next match (restarts after edit of expr)
--- completed part is selected (blue)
--- Ctrl-Z: previous/this match
Shift-Tab: insert line-end from last/previous match
Incremental search in expressions:
-- Alt-F toggles search field, ESC closes
-- Tab/Shift-Tab: next/previous match
-- Enter: 1st match
-- UP arrow: goto found text
Incremental search in Help (Enter/Tab/Shift-Tab: 1st/next/prev match)
-- Up/Down: scroll help text
New keys in calc.ini:
-- MaxHist=99 number of input lines read from history (more saved)
-- KeptOutput=9 number of last results kept in output history _1, _2...
New construct: ";;" line-end comment
Multi-line results shown in one line, `n --> ¦, long lines are truncated (use msg() instead)
Changed msg(x[,x1...,x9]): up to 10 arguments in separate lines
Added run(file): execute list of expressions stroed in file
Added time(Format="",Time=""): formatted time (now) ~ AHK's FormatTime
Added Mode(["DEGree/RADians"]): set/toggle trigonometric domain
Changed all trigonometric functions to work in selected domain
Added FFormat(["format"]): set floating point format, default 0.16e
Window title now shows trig mode [RAD] and floating pt format [0.16e]
Added constants
--- Dmax = 1.7976931348623157e+308 (largest double)
--- Dmin = 2.2250738585072014e-308 (least positive normalized double)
--- Deps = 1.1102230246251565e-016 (=smallest douple: 1 + Deps > 1)
Added fnext(x[,d=1]): next float (add ±d to LS bits of x) for left/right limit
Added f2int(d): integer representation of bits of floating point (double) d
Added int2f(i): floating point representation (double) of bits of integer i
Added Bin2Hex(Addr,Len): Convert Len bytes @ Addr to hex stream
Added Hex2Bin(ByRef Bin, Hex): Convert Hex stream to binary, store in var Bin
Added BC(NumStr,InputBase,OutputBase): Base Conversion
Added from0(x): round away FROM 0
Added to0(x): round toward TO 0 (truncate)
Added diff(y,x): (~differential) y[i] <- x[i+1]-x[i], i=1..x[0]-1
Added cumsum(y,x): (~integral) y[i] <- x[i]+x[i-1]+..+x[1], i=1..x[0]
Added Error function erf(x), related to the normal distribution
Added GAMMA(a[,x]): upper incomplete gamma: Integral(t**(a-1)*e**-t, t=x..inf)
Added LnGamma(a): direct method (less overflow) [balanced: speed vs. code complexity]
Start and End limits of the Axes are now shown in graphs
- All trigonometric functions work now in either Degrees or Radians. The domain can be changed with the Mode() function. The current selection is shown in the title bar of the window.
- Similarly, the computation precision can be set with the Fformat() function, and it is shown in the title bar. The default is the maximum in scientific notation: 0.16e. The parameter is directly given to SetFormat Float, ...
- fnext(x,d) gives the next (normalized) floating point number (double) at a distance of d from x, in the least significant bits. If d=1 the result is the smallest possible machine number larger than x. If an expression is undefined, like “x:=0;sin(x)/x”, you can calculate its (right) limit, if it exists, with “x:=fnext(0);sin(x)/x” or its left limit with “x:=fnext(0,-1);sin(x)/x”. Some built in functions might not be very accurate close to a singularity, so another try with fnext(…,100) could give a sanity check.